Page 1 of 1
How to get image format of CatchImage()?
Posted: Fri Mar 06, 2020 7:44 pm
by skywalk
How to query the format of an image after CatchImage()?
Re: How to get image format of CatchImage()?
Posted: Fri Mar 06, 2020 7:50 pm
by srod
What do you mean by format?
Once captured, the image is stored in an internal bitmap format regardless of whether the original file was a bmp or a jpeg etc.
However, ImageFormat() will return the format of the original file.
Re: How to get image format of CatchImage()?
Posted: Fri Mar 06, 2020 7:57 pm
by RASHAD
Hi skywalk
Code: Select all
CatchImage(0,?Image_000)
format = ImageFormat(0)
Edit :srod was very fast enough

Re: How to get image format of CatchImage()?
Posted: Fri Mar 06, 2020 8:06 pm
by skywalk
Thanks!
I was getting an error during resizeimage().
*.ico not supported. I have to check for that before attempting resizing.
Re: How to get image format of CatchImage()?
Posted: Fri Mar 06, 2020 9:00 pm
by kenmo
I don't understand why ICOs behave differently. You can see in the help that ResizeImage(), DrawAlphaImage(), ImageOutput() etc. don't work with ICO loaded images.
Once loaded by PB, shouldn't all images behave the same?
I wrote an image viewer program, and to allow zooming ICOs I have to redraw them to a second image.
Re: How to get image format of CatchImage()?
Posted: Sat Mar 07, 2020 6:54 am
by RASHAD
Hi skywalk
I did a long time back a utility to convert any image to ICON
Search the forum
If you are using Windows you can use Loadimage_() or Copyimage_() to change the Icon size in memory
So you can change the size after Catchimage()
Re: How to get image format of CatchImage()?
Posted: Sat Mar 07, 2020 12:21 pm
by srod
kenmo wrote:I don't understand why ICOs behave differently. You can see in the help that ResizeImage(), DrawAlphaImage(), ImageOutput() etc. don't work with ICO loaded images.
Once loaded by PB, shouldn't all images behave the same?
I wrote an image viewer program, and to allow zooming ICOs I have to redraw them to a second image.
Well, icons are natively supported by Windows and come with their own AND/XOR masks and color tables etc. which differentiates them from a single DIB for example. As soon as you draw an icon to a DIB, you lose a lot of the information embedded within the various masks. In this regards I can understand why PB treats them slightly differently since the Win API has functions exclusively for use with icons and cursors and so we are free to use these APIs with native icons loaded through PB if we so wish. Having said this, I guess a LoadIcon() in place of LoadImage() might make sense, but then LoadIcon() would be of no use on the other platforms.