0

Hey I am using SHLoadImageFile API ,but i am facing prob in loading images (jpeg) of bigger size. Can anyone help me to solve this?

2
Contributors
6
Replies
8
Views
6 Years
Discussion Span
Last Post by Yashu589
0

Ok!! Here is a brief description followed by the code.
I am trying to load the image from the device, and trying to get its attributes
hBmp = SHLoadImageFile(szFilePath); //szFilePath- refers to loaction of the image
if(!hbmp)
//error msg

current_bmp.Attach(hBmp);
current_bmp.GetBitmap(&hBmpInfo);
// code to get the attributes of the image.

0

I have some more questions:

  1. Does your code work with smaller size JPGs?
  2. If answer to #1 is yes, are you freeing your handle with DeleteObject(hbmp) afterwards?
0

1)works absolutely fine for the lower resolution images.
2)Yes I am freeing the handle as you have said.
I am loading images of different resolutions(from higher to lower resolution).
The problem I am facing is this API wont return a valid handle when i try to load an image of higher resolution(size :640kb),but works absolutely fine for the rest of the lower resolution images.

0

I just did some quick research on Google. It seems that the API cannot handle high resolution images. I'm afraid you might have to go with something else, maybe even a 3rd party lib. Sorry!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.