Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 862
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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