Author Topic: EZ_GetImageSize  (Read 2411 times)

Brian Reynolds

  • Newbie
  • *
  • Posts: 22
    • View Profile
EZ_GetImageSize
« on: May 29, 2022, 12:17:31 am »
I have had to reinstall EZGUI50pro and I can't find any details on the use of EZ_GetImageSize.
This may be an update after I bought EZGUI50pro.
Help required.

Chris Boss

  • Administrator
  • Jr. Member
  • *****
  • Posts: 60
    • View Profile
Re: EZ_GetImageSize
« Reply #1 on: May 29, 2022, 05:58:31 pm »
No such command in EZGUI.

Likely you may have used a function wrapper for other commands which you found on the forum.

Often when i write such a wrapper function I name it with the EZ_ prefix.

The command you need is:

 EZ_GetBitmapInfo hBmp&, W&, H&, PixelBits&, DIBPtr&

This will require calling the EZ_ImageHandle function to get an actual Bitmap handle from an EZGUI Picture name string (ie. EZ_LoadImage returns an internal name EZGUI uses to track a bitmap).


Brian Reynolds

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: EZ_GetImageSize
« Reply #2 on: May 29, 2022, 06:21:32 pm »
That's odd. I got the following clip from your website a fair while ago but its not the complete info that was on the site. I can't find the complete info now. It was for loading files other than .BMP, such as .JPG, .PNG, etc. I used it a lot:

EZ_GetImageSize F$, W&, H&
Reads an image file and returns the size (width and height) in pixels, without loading.
F$ is the filename (full path) of any Image file windows supports (ie. JPeg, PNG,
GIF)
W& is a long variable to return the width in pixels
H& is a long variable to return the height in pixels
P$ = EZ_LoadImage (F$, W&, H&, QFlag&)
Loads an image file.
F$ is the filename (full path) of any Image file windows supports (ie. JPeg, PNG,
GIF)
W& is the requested width of the image (in pixels)
H& is the requested height of the image (in pixels)
QFlag& if set to non-zero (1) requests best quality possible
If W& and H& are set to -1 (or even zero) then the routine will use the actual size of
the image on file.
The return value (P$) is a valid EZGUI Picture string similiar to the return value of
EZ_LoadPicture.
« Last Edit: May 29, 2022, 08:28:31 pm by Brian Reynolds »

Chris Boss

  • Administrator
  • Jr. Member
  • *****
  • Posts: 60
    • View Profile
Re: EZ_GetImageSize
« Reply #3 on: May 29, 2022, 08:57:18 pm »
EZGUI can not load image files other than Bitmaps (and icons, cursors).

The code you are referring to was based on code posted by Dan Ginzel which uses GDI+ API's to load JPG, PNG, etc and then return an EZGUI Picture string.

The code was on the forum, but I lost all the forum posts when upgrading the forum and have yet been bale to restore any of the old posts.