Re: GDI+ Image::Save() function returns InvalidParameter



"shaji" <shajiparemmal@xxxxxxxxx> wrote in message
news:f7e78c77-8acd-4b0b-8e84-72390867dbaa@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Need I prepend any header information to the buffer before creating
the Image object?

Well, does it work if you save your data to a file, then create Image
object giving it the file name? If that fails, the problem is with your
data.

The MS documentation does not disclose much about
the requirements of the IStream object.

It should be image data in one of the formats GDI+ understands, e.g.
BMP, GIF or JPG.

You mentioned "raw pixel data", whatever that means. Perhaps if you can
massage it into one of the formats compatible with Windows bitmaps, you
could use Bitmap(BITMAPINFO*, void*) or Bitmap(int, int, int,
PixelFormat, BYTE*) constructors. See documentation on BITMAPINFO and
BITMAPINFOHEADER for a description of supported formats.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: Options when it comes to searching dates?
    ... declare @date int ... declare @time int ... You must parse and then be ... > Can I assume that you are referring to free-form date formats, ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Loading bitmap from stream
    ... The "standards" on 16 bpp bitmaps are a bit ambiguous and I ... > protected virtual int OnNotifyMessage ... > internal uint dword1; ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Mapping - Another Choice
    ... >> Import pre-existing electronic mapping??? ... but probably not the formats that Anquet and MM use. ... it's about "jpeg and bitmaps". ...
    (uk.rec.walking)
  • [PATCH] reiserfs: fix unaligned bitmap usage
    ... The bitmaps associated with generation numbers for directory entries ... The following patch uses the standard bitmap declaration macros to ... int de_entrylen; ...
    (Linux-Kernel)
  • Re: Using VisualBasic 6 Random Access Files in dotnet
    ... formats haven't. ... int oh_here; ... I tought all data in a file where binary data... ...
    (microsoft.public.dotnet.languages.csharp)