Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Saving an Inform picturebox.
#1
This involves using Inform.
I've figured out how to load images generated within the program into picture boxes and edit them but I haven't figured out how to save a picturebox as an image file.

It is possible to have all graphics commands write to a buffer image that is loaded into a picturebox when needed throughout execution of the program, and save that to a file when desired.  But that defeats some of the purpose of using Inform.

Any ideas?
Reply
#2
Doesn't inForm have an Image property for the Picture Box Control which is a handle you can use with the newish _SaveImage routine?
b = b + ...
Reply
#3
(05-07-2025, 06:46 PM)bplus Wrote: Doesn't inForm have an Image property for the Picture Box Control which is a handle you can use with the newish _SaveImage routine?

you can load an image file into a picturebox with a filename as per doumentation
Code: (Select All)
LoadImage Control(PictureBox), ImageFile$

or you can also do this with BeginDraw and EndDraw
Code: (Select All)

                limage& = _LoadImage(Imagefile$)
                BeginDraw PictureBox1
                _PutImage (0, 0), limage&
                EndDraw PictureBox1

but I haven't figure out how to save out a picturebox itself. 

my problem is while  this would add a circle to the picturebox
Code: (Select All)

                
                BeginDraw PictureBox1
                circle(30,30),12,_rgb32(100,100,200)
                EndDraw PictureBox1

I have no clue how to save that out as an image file from the picturebox. If I could find an image handle in the inform code I could do it but I just haven't figured it out. (or if it has any for the picturebox itself).
Reply
#4
I would think the piture box keeps an image handle property for the current image being displayed after mods to original. How else would refresh work?

https://github.com/FellippeHeitor/InForm...icture-box

nope! see Fellippe Heitor Smile
b = b + ...
Reply
#5
Using "BeginDraw foo" sets foo as the current destination image. You could then simply use "_SAVEIMAGE fileName$" to write out the current destination image to disk.
Reply




Users browsing this thread: 1 Guest(s)