Save form1.image with forelayer drawings

hung

Member
Licensed User
My codes using ImagelibEx as below:
...
form1.image = "background.bmp"
...
form1.FLine(pts(cntpt(cntshape) -1).x, pts(cntpt(cntshape) - 1).y, x, y, cCol)
...
imgex.saveimage(form1.image, fname)
...

I want to do two things:
1. save the image without forelayer
2. save the image with forelayer

The imgex.saveimage(form1.image, fname) has done job 1, but how to do job 2?
:sign0085:
 

klaus

Expert
Licensed User
There is no direct possibility to save the background and or foreground images of a form.

There is a possibility to do it with the ImageLibEx functions.
What you need is the following:
- a bitmap for the form's background image
- a drawer for the form's background image
- a bitmap for the form's forleayer image
- a drawer for the form's forleayer image
- a drawer for the form' background
- a drawer for the form's forleayer

The attached program shows how you could do it.
Buttons:
Draw: draws a rectangle onto the forelayer
Erase: erases the forelayer
New: puts a new image onto the background
AddBmp: copies the forelayer bitmap onto the background image
Trans: transfers the background bitmap onto the form's background
Save both: saves the background bitmap, both after AddBmp
Save forelayer: saves the forleayer bitmap

If you need to keep the original background image you need one bitmap object more for it.

Best regards.
 

hung

Member
Licensed User
Thanks for the work around.
 
Top