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?

Member Avatar for MonsieurPointer

Where's the code? We aren't mind readers, you know.

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.

Member Avatar for MonsieurPointer

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?

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.

Member Avatar for MonsieurPointer

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!

Hmmm yeah may be... Thanks for your help...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.