MAUI Blazor Create temp image to use with cropper blazor iOS - Stack Overflow

iOSI'm creating an app that has the ability to change their profile picture. I want to load an im

iOS

I'm creating an app that has the ability to change their profile picture. I want to load an image from the media library and use it in Cropper.Blazor.

Cropper HTML

<CropperComponent Class="temp-image" Src="/images/tempimage.jpg" @ref="cropperComponent" Options="CropperOptions" />

The issue is that the cropper component can only accept a url for the src so I can't use image data.

I had the following ideas:

1: save the image byte[] to wwwroot/images, but iOS doesn't allow you access.

2: save the image byte[] to appdata, but I can't serve the image to the razor component as there's no url.

3: Create a controller/action in the app that serves the image from appdata and give the url to the razor component. Except, you can't seem to create controllers in MAUI Blazor.

I'm trying to do this locally for cropping, before uploading the image to a webapi.

I don't know what to try next

iOS

I'm creating an app that has the ability to change their profile picture. I want to load an image from the media library and use it in Cropper.Blazor.

Cropper HTML

<CropperComponent Class="temp-image" Src="/images/tempimage.jpg" @ref="cropperComponent" Options="CropperOptions" />

The issue is that the cropper component can only accept a url for the src so I can't use image data.

I had the following ideas:

1: save the image byte[] to wwwroot/images, but iOS doesn't allow you access.

2: save the image byte[] to appdata, but I can't serve the image to the razor component as there's no url.

3: Create a controller/action in the app that serves the image from appdata and give the url to the razor component. Except, you can't seem to create controllers in MAUI Blazor.

I'm trying to do this locally for cropping, before uploading the image to a webapi.

I don't know what to try next

Share Improve this question asked Mar 8 at 2:36 Rob WhiteRob White 1,0021 gold badge8 silver badges22 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

https://stackoverflow/a/75282680/2726160

I eventually found this post. Amazing thank you!

Describes creating a new WebView class that provides access to appdata and replacwa the WebView in MainPage.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744904743a4600185.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信