Android Question [Solved] How to save a webp image in exact size of 512x512?

asales

Expert
Licensed User
Longtime User
I create a bitmap from a panel and I want to save this bitmap in a webp image format with the exact size of 512x512.

I tried this code, but don't works. The size the image saved is about 1500x1500.
B4X:
Dim x As B4XView = panel1
Dim b As Bitmap = x.Snapshot

Dim bm As Bitmap
Dim out As OutputStream
out = File.OpenOutput(img_dir, img_name, False)
bm.Initialize3(b)

bm.Resize(512, 512, True)
bm.WriteToStream(out,70,"WEBP")

Thanks in advance for any tip.
 

TILogistic

Expert
Licensed User
Longtime User
see:
bm.Resize(512, 512, False).WriteToStream(out,70,"WEBP")
B4X
 
Last edited:
Upvote 0

asales

Expert
Licensed User
Longtime User
Thanks @oparra!
I had another issues with the webp format (I'll post in another thread), but now it save with the exact size.
 
Upvote 0
Top