Restored from previous forum. Originally posted by PB.
Anyone know how to save an ImageGadget's picture to disk? Thanks!
PB - Registered PureBasic Coder
Saving ImageGadget picture to disk?
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Paul.
Works fine here...
Works fine here...
Code: Select all
LoadImage(1,"c:\picture.bmp")
InitGadget(1)
If OpenWindow(0,10,10, 300, 300, #PB_Window_SystemMenu,"Test")
If CreateGadgetList(WindowID())
ImageGadget(1,10,10,50,50,UseImage(1))
EndIf
EndIf
Repeat
EventID.l = WaitWindowEvent()
If EventID=#PB_EventCloseWindow
SaveImage(1,"C:\picture.bmp")
quit=1
EndIf
Until quit=1
End
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
code, rather than loading the pic from disk first. So, do you know a way to save
an ImageGadget's pic to disk, based on the ImageGadget getting its pic from the
clipboard?
PB - Registered PureBasic Coder
Edited by - PB on 23 January 2002 20:51:21
Ta -- but I neglected to mention that I was using your clipboard-to-ImageGadgetWorks fine here...
LoadImage(1,"c:\picture.bmp") [...]
code, rather than loading the pic from disk first. So, do you know a way to save
an ImageGadget's pic to disk, based on the ImageGadget getting its pic from the
clipboard?
PB - Registered PureBasic Coder
Edited by - PB on 23 January 2002 20:51:21
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
That's a problem!
First create a Image with: CreateImage -> but you don't know the real size of your clipboard image.
Then copy the clipboard image to the Image created with CreateImage -> no PureB command available for that.
After that you can save it to disk with SaveImage...
We need solutions for:
get the size of a pasted clipboard image
copy the pasted clipboard image to a new created image.
New command needed: CreateImageFromMemory(@image)
If you need the size for further use: we have ImageWidth and ImageHeight
Or/And a command like: SaveImageFromMemory(@image)
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 23 January 2002 22:08:58
That's a problem!
First create a Image with: CreateImage -> but you don't know the real size of your clipboard image.
Then copy the clipboard image to the Image created with CreateImage -> no PureB command available for that.
After that you can save it to disk with SaveImage...
We need solutions for:
get the size of a pasted clipboard image
copy the pasted clipboard image to a new created image.
New command needed: CreateImageFromMemory(@image)
If you need the size for further use: we have ImageWidth and ImageHeight
Or/And a command like: SaveImageFromMemory(@image)
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 23 January 2002 22:08:58