Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 852
  • Last Modified:

Alternative for OleLoadPicture function

I have an image file (any type). I read it  buffer by buffer (of type byte) then I place the content into a memory area of size of the file allocated using GlobalAlloc function. My idea is to have the content of the file transfered to this global memory area. Then I have to create a picture object on the contents of this memory area. I tried OleLoadPicture but it fails in the case of corrupted images. I would like to have an alternative method for doing the above function
0
tincyt
Asked:
tincyt
  • 3
  • 2
1 Solution
 
chensuCommented:
>I tried OleLoadPicture but it fails in the case of corrupted images. I would like to have an alternative method for doing the above function

What do you mean? If the images are corrupted, why do you still want to open them?
0
 
tincytAuthor Commented:
It is known only that the file is an image file. It can be identified whether it is corrupted or not and also the module doesnot know what type of image is it
0
 
chensuCommented:
>It can be identified whether it is corrupted or not

Can or cannot?

>Alternative for OleLoadPicture function

What functionality are you looking for?

What exactly is that you are trying to do?
0
 
tincytAuthor Commented:
It cannot be identified whether it is corrupted or not.

I want to read  the file content, place it in global memory allocated and then create a picture object with the content of the global memory. I don't want to use OleLoadPicture function
0
 
chensuCommented:
OleLoadPicture should return you an error code when the image is corrupted.  What functionalities are you looking for that are not provided by OleLoadPicture?
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now