How to store an image inside a file ?
Hi !
I try to create a file that contains some images (in JPEG or PNG format) and some other binary data.
To store the images, I plan to use GDI+ and the Image::Save() method. So I need an IStream object.
To store the other binary data, I plan to use the standard ofstream::write() method. So I need an ofstream object.
Are these two objects (IStream and ofstream) compatible ? And how can I find one from the other ?
Thanks for your help.
Re: How to store an image inside a file ?
Why IStream? :confused:
Why not just use this overloaded method:
Code:
HRESULT Save(
LPCTSTR pszFileName,
REFGUID guidFileType = GUID_NULL) const throw();
:rolleyes:
Re: How to store an image inside a file ?
Thanks VictorN for your answer.
The Save(pszFileName,guidFileType) method fits well when you have to store only an image in the file.
But, in my case, I have to write some other data before and after the image, in the same file. So I need to write the image in an opened file.