B bdiscount Active Member Licensed User Sep 4, 2007 #1 The title says it all. Is there a way to save a section(x1,y1,x2,y2) of a image to a bmp file, not the whole form. I wrote a simple paint program over the weekend but need to be able to save a section to bmp for use in other programs. I also have a problem with setpixel etc. What is B4pobject? I don't seem to have it. Thanks [email protected]
The title says it all. Is there a way to save a section(x1,y1,x2,y2) of a image to a bmp file, not the whole form. I wrote a simple paint program over the weekend but need to be able to save a section to bmp for use in other programs. I also have a problem with setpixel etc. What is B4pobject? I don't seem to have it. Thanks [email protected]
Erel B4X founder Staff member Licensed User Longtime User Sep 5, 2007 #2 Yes it is possible using the ImageLib library. You should create a bitmap object and a drawer object that will draw over this bitmap. Now draw the form's image on the bitmap using drawer.DrawImage1. It allows you to choose which part of the source image will be drawn. Save the bitmap image using ImageLibEx (and bitmap.Value). Only the bitmap object supports SetPixel. B4PObject is a keyword that is sometimes required by other libraries. For example: Code: Copy [FONT=Times New Roman][COLOR=#010101]drawer.New2 (ImageList1.Item(0), B4PObject(5))[/COLOR][/FONT]
Yes it is possible using the ImageLib library. You should create a bitmap object and a drawer object that will draw over this bitmap. Now draw the form's image on the bitmap using drawer.DrawImage1. It allows you to choose which part of the source image will be drawn. Save the bitmap image using ImageLibEx (and bitmap.Value). Only the bitmap object supports SetPixel. B4PObject is a keyword that is sometimes required by other libraries. For example: Code: Copy [FONT=Times New Roman][COLOR=#010101]drawer.New2 (ImageList1.Item(0), B4PObject(5))[/COLOR][/FONT]