✅ Image from dataurl
I have dataurl with image and i need to get it to some reasonable image object in c#, so i can resize it and get bytes from the resized image. I was playing with skiasharp bitmap, but i couldn't figure it out.
20 Replies
@Binto86 use my code to convert a data URL to an image in C#
thanks, unfortunately im not on windows, this is wasm, so i can't really use System.Drawing
macOS?
or Linux?
otherwise, im doing the same to extract the bytes from the url so...
webassembly
okay one second
@Binto86 so i try to write a code for u with SkiaSharp
thank you
i did try skiasharp but i couldn't get it to work with
SKBitmap.Decode
or anything
im trying ImageSharp now
@Binto86 try that
@Binto86 working?
my SKImage doesn't have Save function
im trying to solve that
ok, did this instad
now im getting the bytes back
i just can't tell if its actually resized or not
anyways, thank you very much
You can check the size of the resized image by comparing the width and height properties of the original SKBitmap and the resized SKBitmap.
i don't think it was
but i changed the code a bit
so hopefully
okay
text me if u need help again
yes it works
tysm
😊
No Problem
the skiasharp lib is acting really weird and unexpectedly
What is happening?
How long have you been programming with csharp? @Binto86
rn nothing as its solved
2 years
okok
the api of the lib is just weird imo
i correct the code
wait
this should be a better version of the code and should work fine
@Binto86
yes this is what i changed your original code to and works just fine