473,372 Members | 1,073 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

create Bitmap from rawbuffer(BYTE*)

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

I do following:

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

pictureBox->set_Image(myBit2 );

the Bitmap were not correct displayed

MFC
Soja

Nov 16 '05 #1
2 2118
"Soja" <so*****@web.de> wrote in message
news:e9**************@TK2MSFTNGP12.phx.gbl...
How can i create a Bitmap from a rawbuffer-BYTE* (from framegrapper).

I do following:

Bitmap *myBit2 = new
Bitmap(wImage,hImage,wImage*sizeof(BYTE),PixelForm at::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
Nov 16 '05 #2
A read cross were displayed(nothing) and exception raise after
pictureBox->set_Image(myBit2);

System.InvalidOperationException
"Ken Alverson" <Ke*@Alverson.net> schrieb im Newsbeitrag
news:ep**************@TK2MSFTNGP10.phx.gbl...
"Soja" <so*****@web.de> wrote in message
news:e9**************@TK2MSFTNGP12.phx.gbl...
How can i create a Bitmap from a rawbuffer-BYTE* (from framegrapper).

I do following:

Bitmap *myBit2 = new
Bitmap(wImage,hImage,wImage*sizeof(BYTE),PixelForm at::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

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: James Dean | last post by:
I create a bitmap like this. The width and height are got from the compressed file i am reading. The width and height are in pixels.....1bpp bitmap = new...
0
by: CroDude | last post by:
Hi all! I have problems when writting bitmap to a byte array and after reading it back form byte to Bitmap object. What I do is this: First I throw Bitmap to a memory-stream and then I write it...
3
by: biteme | last post by:
I have an array of bytes which i want to write out to a file. What classes do i need that do this?? i know you can do stuff with binary writer and stream writer, but how do i create a file with...
1
by: Angel Filev | last post by:
Hi everyone, I am trying to store a file as a binary array in an "image" field in SQL Server 2000 database. It works OK except for the ".PDF" files, which I believe get corrupted in the process...
5
by: Lance | last post by:
I need to create a Drawing.Bitmap from an array of integer values. My current technique creates a bitmap that eventually becomes corrupt (i.e., the bitmap's pixels change to a different color...
8
by: gsmith | last post by:
Hello, I am developing a video recording (mjpeg) system which records large binary files. I need to read the JPEG data from the binary file and create a bitmap object to be displayed....
4
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I have an RGB color held in a Int32 variable. I using an unsafe code to loop through Bitmap data, and by using the BitmapData.Scan0 pointer I need to copy the Int32 color value into the Bitmap...
5
by: WT | last post by:
I am trying to crete a gif file with transparent backcolor on the fly but it seems that GDI refuses to do this. I am using samples from Bob Powell but it doesn't seem to work. First create a...
2
by: jenniamia | last post by:
I need to make the string "myFile" into a byte and then put it in the database as a file/image, where later it needs to be pulled out and back into a string from the byte. I'm really having trouble...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.