Stretch BitMap
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Rings.
Oh I think it must a bug.
The description of ImageGadget says:
Any reports if this function works correct under other OS's guys ?
Siggi
Oh I think it must a bug.
The description of ImageGadget says:
so 'autofit the image size' does not work on NT and Win2000(as i owned).Create an Image gadget in the current GadgetList. The ImageID represents a BMP file and can be obtained by using UseImage() or ImageID() from the Image library. The gadget dimension autofit the image size. The gadget doesn't have any input, so user interactions (mouse clicks etc...) aren't reported.
Any reports if this function works correct under other OS's guys ?
Siggi
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Rings.
hwnd=OpenWindow(0, 100, 100, 195, 260, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "PureBasic Window")
If hwnd
IMG1=LoadImage(1,"TL.bmp");This bitmap must be in a small size
InitGadget(2)
CreateGadgetList(WindowID())
ButtonGadget(1,20,10,80,25,"EXIT")
ImageGadget(2,0,0,100,100,IMG1)
Repeat
EventID.l = WaitWindowEvent()
If EventID = #PB_EventCloseWindow ; If the user has pressed on the close button
Quit = 1
EndIf
If EventID=#PB_EventGadget ;#PB_EventGadget
GadNR.l=EventGadgetID()
If GadNR.l=1
Quit=1
EndIf
EndIf
Until Quit = 1
EndIf
End
Getting better with a little help from my friends....thx Siggi
okay here it is.Note that you need a small bmp!if you have a snippet to run...
hwnd=OpenWindow(0, 100, 100, 195, 260, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "PureBasic Window")
If hwnd
IMG1=LoadImage(1,"TL.bmp");This bitmap must be in a small size
InitGadget(2)
CreateGadgetList(WindowID())
ButtonGadget(1,20,10,80,25,"EXIT")
ImageGadget(2,0,0,100,100,IMG1)
Repeat
EventID.l = WaitWindowEvent()
If EventID = #PB_EventCloseWindow ; If the user has pressed on the close button
Quit = 1
EndIf
If EventID=#PB_EventGadget ;#PB_EventGadget
GadNR.l=EventGadgetID()
If GadNR.l=1
Quit=1
EndIf
EndIf
Until Quit = 1
EndIf
End
Getting better with a little help from my friends....thx Siggi
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by fred.
When I mean AutoFit, it was than the ImageGadget is always sized like the image size. It seems to be a windows limitation. But I will add a ResizeImage() function to manipulate the bmp. I think you shouldn't have pb to use the WinAPI function to do it for now..
Fred - AlphaSND
When I mean AutoFit, it was than the ImageGadget is always sized like the image size. It seems to be a windows limitation. But I will add a ResizeImage() function to manipulate the bmp. I think you shouldn't have pb to use the WinAPI function to do it for now..
Fred - AlphaSND
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Rings.
Getting better with a little help from my friends....thx Siggi
ResizeImage works now fine (2.90)Okay thx fred.But I will add a ResizeImage() function to manipulate the bmp
Yes ResizeImage should be a native PureBasicFunction.
Getting better with a little help from my friends....thx Siggi
Getting better with a little help from my friends....thx Siggi
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Rings.
Getting better with a little help from my friends....thx Siggi
Oh help me.....i'm totally wrong.What to hell have i done at work.I take a close look...it could be ResizeGadget of course.Are you sure of that ? I don't have any ResizeImage function in my PureBasic version ...ResizeImage works now fine (2.90)
Fred - AlphaSND
Getting better with a little help from my friends....thx Siggi
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Rings.
I wanna do it with native PureBasic-commands.Tile Image-Gadgets on the background.
Getting better with a little help from my friends....thx Siggi
I know, but i have to done it every Windows-Repaint.If you want to strech an Image use WinAPI StretchBlt.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
I wanna do it with native PureBasic-commands.Tile Image-Gadgets on the background.
Getting better with a little help from my friends....thx Siggi
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
The ImageGadget should definitely use the
size that is given in the command arguments
and stretch the bitmap to that size.
Fred:
You can change the command ImageGadget():
1st step: resize the bitmap to the size that is given as the argument
2nd step: create the ImageGadget with the right size
The ImageGadget command should handle
that automatically.
You only need to add a ResizeImage part
at the beginning of the ImageGadget
command.
cya,
...Danilo
(registered PureBasic user)
The ImageGadget should definitely use the
size that is given in the command arguments
and stretch the bitmap to that size.
Fred:
You can change the command ImageGadget():
1st step: resize the bitmap to the size that is given as the argument
2nd step: create the ImageGadget with the right size
The ImageGadget command should handle
that automatically.
You only need to add a ResizeImage part
at the beginning of the ImageGadget
command.
cya,
...Danilo
(registered PureBasic user)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Rings.
And it works.But i also prefer Danilo's way.
Getting better with a little help from my friends....thx Siggi
It was ResizeGadget indeed.Are you sure of that ? I don't have any ResizeImage function in my PureBasic version ...ResizeImage works now fine (2.90)
Fred - AlphaSND
And it works.But i also prefer Danilo's way.
Getting better with a little help from my friends....thx Siggi