Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
GeneralRe: Advise for debugging Pin
Tom Larsen3-Mar-04 11:19
Tom Larsen3-Mar-04 11:19 
GeneralRaw Image to Bmp Image Pin
Alexsander Antunes3-Mar-04 5:44
professionalAlexsander Antunes3-Mar-04 5:44 
GeneralRe: Raw Image to Bmp Image Pin
Mazdak3-Mar-04 5:54
Mazdak3-Mar-04 5:54 
GeneralRe: Raw Image to Bmp Image Pin
Heath Stewart3-Mar-04 6:10
protectorHeath Stewart3-Mar-04 6:10 
GeneralRe: Raw Image to Bmp Image Pin
Alexsander Antunes3-Mar-04 6:25
professionalAlexsander Antunes3-Mar-04 6:25 
GeneralRe: Raw Image to Bmp Image Pin
Mazdak3-Mar-04 6:27
Mazdak3-Mar-04 6:27 
GeneralRe: Raw Image to Bmp Image Pin
Heath Stewart3-Mar-04 6:36
protectorHeath Stewart3-Mar-04 6:36 
GeneralRe: Raw Image to Bmp Image Pin
Heath Stewart3-Mar-04 6:26
protectorHeath Stewart3-Mar-04 6:26 
The Bitmap class and related classes and structs actually support this. You can use the constructor Bitmap(int, int, int, PixelFormat, IntPtr) to create a bitmap of a known size, source format, and the address of the first element in the data buffer. Basically, it uses similar functionality from GDI like the CreateDIBitmap API (although internally it uses GDI+ APIs).

This is untested, but should give you some idea
byte[] img = new byte[7800];
// Fill img
GCHandle gch = GCHandle.Alloc(img);
Bitmap bmp = new Bitmap(300, 260, 2400, PixelFormat.Format25bppRgb,
  gch.AddrOfPinnedObject());
gch.Free();
I don't currently have any raw data to try it out on, but this seems to be the way that is similar to how it's done in good ol' C/C++.

Let me know if it works. My digital camera outputs RAW images and eventually I was going to write a new front end since the one that came with it sucks.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Raw Image to Bmp Image Pin
Mazdak3-Mar-04 6:29
Mazdak3-Mar-04 6:29 
GeneralRe: Raw Image to Bmp Image Pin
Alexsander Antunes3-Mar-04 8:21
professionalAlexsander Antunes3-Mar-04 8:21 
GeneralRe: Raw Image to Bmp Image Pin
Heath Stewart3-Mar-04 8:36
protectorHeath Stewart3-Mar-04 8:36 
GeneralRe: Raw Image to Bmp Image Pin
Alexsander Antunes3-Mar-04 8:51
professionalAlexsander Antunes3-Mar-04 8:51 
GeneralRe: Raw Image to Bmp Image Pin
Heath Stewart3-Mar-04 8:57
protectorHeath Stewart3-Mar-04 8:57 
GeneralRe: Raw Image to Bmp Image Pin
Alexsander Antunes3-Mar-04 8:54
professionalAlexsander Antunes3-Mar-04 8:54 
GeneralRe: Raw Image to Bmp Image Pin
Heath Stewart3-Mar-04 8:58
protectorHeath Stewart3-Mar-04 8:58 
QuestionHow to draw on nonclient area of a form ? Pin
Andres Coder3-Mar-04 5:11
Andres Coder3-Mar-04 5:11 
AnswerRe: How to draw on nonclient area of a form ? Pin
Andres Coder3-Mar-04 5:30
Andres Coder3-Mar-04 5:30 
AnswerRe: How to draw on nonclient area of a form ? Pin
Heath Stewart3-Mar-04 6:09
protectorHeath Stewart3-Mar-04 6:09 
GeneralRe: How to draw on nonclient area of a form ? Pin
Andres Coder3-Mar-04 7:01
Andres Coder3-Mar-04 7:01 
GeneralRe: How to draw on nonclient area of a form ? Pin
Heath Stewart3-Mar-04 8:40
protectorHeath Stewart3-Mar-04 8:40 
GeneralRe: How to draw on nonclient area of a form ? Pin
Andres Coder3-Mar-04 8:44
Andres Coder3-Mar-04 8:44 
GeneralConnecting to MySQL with ODBC Pin
sps-itsec463-Mar-04 3:12
sps-itsec463-Mar-04 3:12 
GeneralRe: Connecting to MySQL with ODBC Pin
Heath Stewart3-Mar-04 6:07
protectorHeath Stewart3-Mar-04 6:07 
GeneralRe: Connecting to MySQL with ODBC Pin
sps-itsec463-Mar-04 8:41
sps-itsec463-Mar-04 8:41 
GeneralMail samples Pin
jimaya3-Mar-04 2:25
jimaya3-Mar-04 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.