Click here to Skip to main content
16,018,347 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem with button click for SPREAD control. Pin
mav.northwind27-Nov-06 18:47
mav.northwind27-Nov-06 18:47 
QuestionHow to change language in MonthCalendar toolbox? Pin
bug_aonz27-Nov-06 17:31
bug_aonz27-Nov-06 17:31 
QuestionGUI to app.config file Pin
justintimberlake27-Nov-06 16:50
justintimberlake27-Nov-06 16:50 
AnswerRe: GUI to app.config file Pin
Not Active27-Nov-06 17:06
mentorNot Active27-Nov-06 17:06 
QuestionData Display Error Pin
Deepasubramanian27-Nov-06 15:29
Deepasubramanian27-Nov-06 15:29 
AnswerRe: Data Display Error Pin
AB777127-Nov-06 21:32
AB777127-Nov-06 21:32 
AnswerRe: Animations Pin
Judah Gabriel Himango27-Nov-06 16:06
sponsorJudah Gabriel Himango27-Nov-06 16:06 
QuestionBitmap to byteArray problem Pin
MacMohan27-Nov-06 12:56
MacMohan27-Nov-06 12:56 
Hi there,

I am new to the graphics section of C#.
I wanted to change the monochrome bitmap to byte array and send the pixel data to the serial thermal printer.

When i convert the bitmap to byte array, the first two byte i get is 13780 instead of 19778 (representation of BM as per bitmap specs). I used the following code as reference:
ImageData = ConvertImageToByteArray(bmp,System.Drawing.Imaging.ImageFormat.Png);

private static byte[] ConvertImageToByteArray(System.Drawing.Image imageToConvert,ImageFormat formatOfImage)
{
byte[] Ret;
using (MemoryStream ms = new MemoryStream())
{
imageToConvert.Save(ms,formatOfImage);
Ret = ms.ToArray();
}
return Ret;
}


if i call the above function as below
ImageData = ConvertImageToByteArray(bmp,System.Drawing.Imaging.ImageFormat.<b>Bmp</b>);
then all the byteArray is filled with 0;

What am i doing wrong? Or is there any other approach for doing this? Any solution and suggestion will be appreciated.

AnswerRe: Bitmap to byteArray problem Pin
Guffa27-Nov-06 13:53
Guffa27-Nov-06 13:53 
GeneralRe: Bitmap to byteArray problem Pin
MacMohan27-Nov-06 17:33
MacMohan27-Nov-06 17:33 
GeneralRe: Bitmap to byteArray problem Pin
Guffa27-Nov-06 19:07
Guffa27-Nov-06 19:07 
AnswerRe: Bitmap to byteArray problem Pin
Andrei Ungureanu27-Nov-06 20:09
Andrei Ungureanu27-Nov-06 20:09 
QuestionRedirecting STDOUT in a stream/textcontrol within a process Pin
Lars Benner27-Nov-06 12:52
Lars Benner27-Nov-06 12:52 
AnswerRe: Redirecting STDOUT in a stream/textcontrol within a process Pin
Judah Gabriel Himango27-Nov-06 15:59
sponsorJudah Gabriel Himango27-Nov-06 15:59 
GeneralRe: Redirecting STDOUT in a stream/textcontrol within a process Pin
George L. Jackson27-Nov-06 16:59
George L. Jackson27-Nov-06 16:59 
GeneralRe: Redirecting STDOUT in a stream/textcontrol within a process Pin
Lars Benner27-Nov-06 20:38
Lars Benner27-Nov-06 20:38 
AnswerRe: Redirecting STDOUT in a stream/textcontrol within a process Pin
George L. Jackson27-Nov-06 18:08
George L. Jackson27-Nov-06 18:08 
GeneralRe: Redirecting STDOUT in a stream/textcontrol within a process Pin
Lars Benner27-Nov-06 20:54
Lars Benner27-Nov-06 20:54 
GeneralRe: Redirecting STDOUT in a stream/textcontrol within a process Pin
George L. Jackson27-Nov-06 23:52
George L. Jackson27-Nov-06 23:52 
AnswerRe: Redirecting STDOUT in a stream/textcontrol within a process Pin
George L. Jackson28-Nov-06 9:33
George L. Jackson28-Nov-06 9:33 
Questionusing data retrieved from gridview Pin
kgarl27-Nov-06 11:06
kgarl27-Nov-06 11:06 
AnswerRe: using data retrieved from gridview Pin
Not Active27-Nov-06 11:28
mentorNot Active27-Nov-06 11:28 
GeneralRe: using data retrieved from gridview Pin
kgarl28-Nov-06 4:37
kgarl28-Nov-06 4:37 
QuestionPossibility in C# Pin
netJP12L27-Nov-06 10:54
netJP12L27-Nov-06 10:54 
AnswerRe: Possibility in C# Pin
Christian Graus27-Nov-06 11:08
protectorChristian Graus27-Nov-06 11:08 

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.