Article View: borland.public.cppbuilder.nativeapi
Article #2111Re: Bitmap GetObject
From: Bob Gonder
Date: Thu, 05 Apr 2007 23:16
Date: Thu, 05 Apr 2007 23:16
27 lines
1889 bytes
1889 bytes
poojo hackma wrote:
>What should be allocated 84 bytes? My CBitmap object "bitmap" and my BITMAP
>structure "BMP" are both heap allocated.
>
>There is an "LPVOID bmBits" in the BITMAP structure. Should I allocate 84
>bytes of data, then point the bmBits to it?
No.
I really know nothing about using jpegs, but I'd bet from what you
have said, that GetObject on a jpeg isn't going to return (just) a
BITMAP.
Something along the lines of
ok = bitmap.GetObject( 0, NULL );
if( ok )
{
char*buffer = new char[ok];
bitmap.GetObject( ok, buffer );
}
OTOH, reading up on CBitmap, I see that what you probably wanted to do
was
ok = bitmap.GetObject( sizeof(BMP), &BMP );
and forget about using the NULL version.
Though it would be easier to use Bruce's suggestion, and do
ok = bitmap.GetBitmap( & BMP );
Technical Details
Message-ID:
<kgva13de4tnms6bevkvdco4a6e4ch5ns8u@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4613f4bc@newsgroups.borland.com> <840a13tv68iop0hgv2keepb1bcrcg5btk9@4ax.com> <46151d8d@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,cc67b7c92694fec8 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Bitmap GetObject Date: Thu, 05 Apr 2007 16:16:16 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <kgva13de4tnms6bevkvdco4a6e4ch5ns8u@4ax.com> References: <4613f4bc@newsgroups.borland.com> <840a13tv68iop0hgv2keepb1bcrcg5btk9@4ax.com> <46151d8d@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 69.69.80.223 X-Trace: newsgroups.borland.com 1175814973 69.69.80.223 (5 Apr 2007 16:16:13 -0800) Lines: 30 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail