ability to use actual image HANDLE in native PB img commands

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

ability to use actual image HANDLE in native PB img commands

Post by localmotion34 »

in the docs it details examples of resizeimage(), copyimage(), imagewidth() and so on using the PB NUMBER. (imagewidth takes no input actually, and just returns the image that is active, and doesnt work when you are working with API or itemdata images. now i have written subclassed listbixes and other gadgets where the itemdata is the OS HANDLE (hbitmap) of the image. what would be great is the ability to do the following:

resizeimage(hbitmap,width,height)

if i try this, it crashes:

hbitmap=sendmessage_(gadgetid(listbox),#lb_getitemdata,item,0)
resizeimage(hbitmap,width,height)

what if where you could still use the PB NUMBER like:
resizeimage(useimage(22),width,height)

where the OS HANDLE of the image is the actual input to the command like creategadgetlist(windowid(2)). the creategadgetlist command requires the OS handle as input which is obtained with windowid().

or if the imageID() or imagewidth() commands could accept actual image numbers like:

imagewidth(imageid(#image2)) or imagewidth(#image2) (i'd prefer using the OS handle though)

or if compatibility is an issue, maybe a command that can dynamically assign a PB NUMBER to an itemdata hbitmap or hbitmap like:
PB_Image_Number=assignPBimagenumber(hbitmap)

so we can do:

hbitmap=sendmessage_(gadgetid(listbox),#lb_getitemdata,item,0)
resizeimage(assignPBimagenumber(hbitmap),width,height)

all i am saying is that there seems to be a gap between native PB image commands and that of images only with hbitmap OS handles.

i dont ask for much at all, but is there a possibility that we will be able to use hbitmap OS image handles as part of the native PB command set?

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post by localmotion34 »

wow--no one wants to see this either?

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
Post Reply