create Bitmap from rawbuffer(BYTE*)

S

Soja

How can i create a Bitmap from a rawbuffer-BYTE* (from framegrapper).

I do following:

Bitmap *myBit2 = new
Bitmap(wImage,hImage,wImage*sizeof(BYTE),PixelFormat::Format8bppIndexed
,(IntPtr)pbyteBuffer);

pictureBox->set_Image(myBit2 );

the Bitmap were not correct displayed

MFC
Soja
 
K

Ken Alverson

Soja said:
How can i create a Bitmap from a rawbuffer-BYTE* (from framegrapper).

I do following:

Bitmap *myBit2 = new
Bitmap(wImage,hImage,wImage*sizeof(BYTE),PixelFormat::Format8bppIndexed
,(IntPtr)pbyteBuffer);

pictureBox->set_Image(myBit2 );

the Bitmap were not correct displayed

Perhaps if you told us how it was being displayed. Wrong colors? Upside
down? Backwards? Not the image at all (garbage)?

Ken
 
S

Soja

A read cross were displayed(nothing) and exception raise after
pictureBox->set_Image(myBit2);

System.InvalidOperationException
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top