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?
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
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
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Running QB64 v2 InForm Programs on PE Magdha 2 355 11-19-2025, 11:10 AM
Last Post: Magdha
  How does QB64 support saving 8bit images? CMR 4 775 04-27-2025, 04:46 PM
Last Post: CMR
  Looking for InForm installer for Windows GTC 16 3,032 10-17-2023, 12:35 AM
Last Post: a740g
  Inform the user(s) of new releases doppler 4 1,012 09-10-2022, 07:23 PM
Last Post: SpriggsySpriggs
  Inform SquirrelMonkey 3 907 07-16-2022, 02:10 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)