Closed MarvinKlein1508 closed 3 years ago
Hi, This error is not related to base64 image. You forgot to add
in _Host.cshtml
Anyway without this missing line it was not working. I fixed it, please upate and look at this example Index.razor
@iso8859 I had this code in my _Host.cshtml. I did everything as you described in your READ.ME
I will check out the update later today and let you know if it works or not.
@iso8859 with the updated library it works fine for me. However, you forgot to publish the update to nuget.
@MarvinKlein1508 I forget. Update published.
I want to use this library within a blazor server application. However, I don't have the images as image file. I only have them as base64 string.
When I try to display such string, my application crashes and gives me the following error message:
[2021-03-18T16:39:06.287Z] Error: Microsoft.JSInterop.JSException: Could not find 'WheelZoomJsFunctions.boundingRect' ('WheelZoomJsFunctions' was undefined). r</e.prototype.findFunction/<@https://localhost:5001/_framework/blazor.server.js:1:67390 r</e.prototype.findFunction@https://localhost:5001/_framework/blazor.server.js:1:67350 v@https://localhost:5001/_framework/blazor.server.js:1:69092 beginInvokeJSFromDotNet/i<@https://localhost:5001/_framework/blazor.server.js:1:70038 beginInvokeJSFromDotNet@https://localhost:5001/_framework/blazor.server.js:1:70011 O</e.prototype.invokeClientMethod/<@https://localhost:5001/_framework/blazor.server.js:1:26293 O</e.prototype.invokeClientMethod@https://localhost:5001/_framework/blazor.server.js:1:26263 O</e.prototype.processIncomingData@https://localhost:5001/_framework/blazor.server.js:1:24201 e/this.connection.onreceive@https://localhost:5001/_framework/blazor.server.js:1:17286 J</e.prototype.connect/</</</i.onmessage@https://localhost:5001/_framework/blazor.server.js:1:46503
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at BlazorWheelZoomLibrary.Shared.WheelZoom.InitAsync()
at BlazorWheelZoomLibrary.Shared.WheelZoom.OnAfterRenderAsync(Boolean firstRender)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
I implemented your component as:
<WheelZoom Image="@($"data:image/png;base64, {image}")" width="583" height="820" />