Hi @Saeed Pooladzadeh,
CS1503 Argument 2: cannot convert from 'method group' to 'Microsoft.AspNetCore.Components.EventCallback' 10
You need create the function with ChangeEventArgs
when you use @oninput
:
private async Task ConvertImage(ChangeEventArgs e)
But from your code, you need use InputFileChangeEventArgs
to get the multiple file, so you need change your code like below:
<InputFile OnChange="@ConvertImage" accept="image/*" />
CS1503 Argument 2: cannot convert from 'byte[]' to 'object?[]?' 52
Change to JSRuntime to JsRuntime . It should be JsRuntime which is the instance name(@inject IJSRuntime JsRuntime)
VectorSvg = await JsRuntime.InvokeAsync<string>("convertToVector", imageBytes);
CS0136 A local or parameter named 'e' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter 54
You have declared InputFileChangeEventArgs e
in this function, so change the name:
catch (Exception ex)
{
Console.WriteLine($"Unexpected error: {ex.Message}");
}
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Rena