ImageGadget dimensions
Posted: Wed Sep 27, 2023 11:47 am
I've always found it weird that ImageGadgets resize themselves to the image dimensions that they hold. How about an optional flag for them to stay what the specified gadget width/height actually is (and put the image in the center of it), instead of resizing to what the image width/height is? Like this:
Currently I have to use my own procedure to do the job, which isn't ideal and involves copying the source images (LOTS of them).
Code: Select all
LoadImage(0,#PB_Compiler_Home+"Examples\Sources\Data\Geebee2.bmp") ; 128 x 128 pixels.
OpenWindow(0,0,0,640,320,"Image Scale",#PB_Window_SystemMenu)
ImageGadget(1,10,10,0,0,ImageID(0)) ; Shown at 128 x 128 (the actual image size, hence why W/H are both set to 0).
ImageGadget(2,200,10,256,256,ImageID(0)) ; Want this ImageGadget to be 256 x 256 without resizing or copying the image.
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow