Page 1 of 1

CatchImage Function

Posted: Thu Dec 30, 2004 3:59 pm
by Vater
Hello NG,

I use the API ExtractIcon to get the handle of an icon File stored in a Exe File. Can I use CatchImage to create an Image Object in Memory and then Save it.
Here is how I try it

lngRetValue = ExtractIcon_(0, strCompleteFilename, 2)
If lngRetValue <> 0
CatchImage(0, lngRetValue)
SaveImage(lngRetValue, strZielverzeichnis + "\" + strFilename + ".bmp")
EndIf

Unfortunately this doesn't work. I thet a ReturnValue form the _ExtractIcon Function but i'm not able to catch the image with it.
Do I misunderstand the CatchImage function?

Thanks in advance

Stefan

Posted: Thu Dec 30, 2004 5:10 pm
by Paul
You could do it this way...

Code: Select all

strCompleteFilename.s="x:\test.exe"

lngRetValue = ExtractIcon_(0, strCompleteFilename, 0)

If lngRetValue
  CreateImage(1,32,32)
  StartDrawing(ImageOutput())
    DrawImage(lngRetValue,0,0)
  StopDrawing()

  SaveImage(1, "test.bmp")
EndIf