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

C#

 
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 
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 
Hi,
Try using this code to copy the bytes form a bitmap to a byte array:

<br />
public byte Copy(Bitmap img)<br />
{<br />
  BitmapData imgData = img.LockBits(new Rectangle(0, 0, img.Width, img.Height),   ImageLockMode.ReadWrite, img.PixelFormat);<br />
  IntPtr scan = imgData.Scan0;<br />
  byte[] buffer = null;<br />
  if (img.PixelFormat == PixelFormat.Format24bppRgb)<br />
        buffer = new byte[img.Width * (img.Height / 3) * 3];<br />
  else<br />
        buffer = new byte[img.Width * (img.Height / 3) * 4];<br />
  Marshal.Copy(scan, buffer, 0, buffer.Length);<br />
  img.UnlockBits(imgData);<br />
  return buffer;<br />
}<br />
<br />
 Hope it helps<br />


Do your best to be the best

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 
JokeRe: Possibility in C# Pin
Paul Conrad27-Nov-06 19:51
professionalPaul Conrad27-Nov-06 19:51 
GeneralRe: Possibility in C# Pin
Pete O'Hanlon27-Nov-06 22:34
mvePete O'Hanlon27-Nov-06 22:34 
QuestionHow To programming Client/Server database ? Pin
hdv21227-Nov-06 9:58
hdv21227-Nov-06 9:58 
AnswerRe: How To programming Client/Server database ? Pin
Michael P Butler27-Nov-06 10:34
Michael P Butler27-Nov-06 10:34 

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.