asales Expert Licensed User Longtime User May 16, 2021 #1 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: Copy 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.
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: Copy 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 May 16, 2021 #2 see: bm.Resize(512, 512, False).WriteToStream(out,70,"WEBP") Click to expand... B4X Size of PNG file created by Rootpane.SnapShot [SOLVED] Hello All, I am saving a snapshot of my form to a PNG file. The form is 1100 x 800 pixels and I have the following in my code: #Region Project Attributes #MainFormWidth: 1100 #MainFormHeight: 800 #End Region Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1... www.b4x.com Last edited: May 16, 2021 Upvote 0
see: bm.Resize(512, 512, False).WriteToStream(out,70,"WEBP") Click to expand... B4X Size of PNG file created by Rootpane.SnapShot [SOLVED] Hello All, I am saving a snapshot of my form to a PNG file. The form is 1100 x 800 pixels and I have the following in my code: #Region Project Attributes #MainFormWidth: 1100 #MainFormHeight: 800 #End Region Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1... www.b4x.com
asales Expert Licensed User Longtime User May 16, 2021 #3 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
Thanks @oparra! I had another issues with the webp format (I'll post in another thread), but now it save with the exact size.