For anyone familiar with my "Using Picture Objects" tutorial, I have news.

The entire LoadPictureFile procedure may be replaced by a single API method OleLoadPicturePath:



invoke OleLoadPicturePath, ADDR wsPicFileName, NULL, NULL, NULL,
ADDR IID_IPicture, ADDR gpPicture1


where gpPicture1 is the retuened IPicture object, and wsPicFileName is the file you wish to open.

The sole complication is that wsPicFileName needs to be a Unicode string. The MultiByteToWideChar API can make this conversion for you.
Posted on 2001-12-28 11:59:18 by Ernie
So if i understand this, your previous tutorial should be renamed to somehing like "how to write the OleLoadPicturePath API with COM" :grin:

Thanx for the update! Got 1 Question tho:

Is this API a fully suported API by M$, or is this one of those "mystery API"s that ms abandoned but left into the bloat?

Thanx..
NaN
Posted on 2002-01-03 03:28:34 by NaN
MSDN doesn't have any disclaimers such as "not for new development," so it might be around a while.
Posted on 2002-01-04 17:59:34 by Ernie
how can I save the original data back to
a file?

The picture saves itself always as BMP format.
Posted on 2002-01-08 07:18:05 by beaster
Beaster: Hey, that's weird, VB has the same limitation on their Picture control :rolleyes:
Posted on 2002-01-08 10:29:50 by Qweerdy
That is a problem, but I thought of something else last night...

If you're using a Windows API to load a gif file, you are NOT using any copyrighted material (ie, the dreaded LZW compression method) in your code.

Therfor you owe nobody nothin! The only limitation seems to be the API only opens simple images, not moving multiple frame ones.
Posted on 2002-01-08 11:00:59 by Ernie