Click here to Skip to main content
15,885,985 members
Home / Discussions / C#
   

C#

 
GeneralRe: sort a Datagrid Pin
Heath Stewart27-Apr-04 2:55
protectorHeath Stewart27-Apr-04 2:55 
GeneralRe: sort a Datagrid Pin
Appelz27-Apr-04 2:54
Appelz27-Apr-04 2:54 
GeneralRe: sort a Datagrid Pin
Heath Stewart27-Apr-04 3:12
protectorHeath Stewart27-Apr-04 3:12 
GeneralRe: sort a Datagrid Pin
Appelz27-Apr-04 3:26
Appelz27-Apr-04 3:26 
GeneralRe: sort a Datagrid Pin
Heath Stewart27-Apr-04 3:44
protectorHeath Stewart27-Apr-04 3:44 
GeneralRe: sort a Datagrid Pin
Appelz27-Apr-04 23:43
Appelz27-Apr-04 23:43 
GeneralRe: sort a Datagrid Pin
Appelz28-Apr-04 0:02
Appelz28-Apr-04 0:02 
QuestionHow to change from Byte[] to Bitmap on a Pocket PC Pin
Gakujin22-Apr-04 19:10
Gakujin22-Apr-04 19:10 
Okay, the situation is this: I saved a Bitmap using the Bitmap.Save method into a MemoryStream and then I used the MemoryStream.ToArray() method to turn it into a Byte[] array. I used a Socket to send the the Byte[] (buffer) and recieved the buffer in a remote side (Mostly on a Pocket PC), I cannot seem to find a way to return that Byte[] back to a Bitmap, I tried using the MemoryStream(Byte[]) constructor in order to save it on a memory stream, and then using the Bitmap(System.IO.Stream) constructor but it returns an exception stating that it is an invalid parameter or argument, I would thank all who could help me solve this problem, here's an example of what I have been doing to send and recieve my Bitmap:

//Sending:

Bitmap bmp = new Bitmap(@openDialog1.FileName);
System.IO.MemoryStream memImage = new MemoryStream();
bmp.Save(memImage,System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] data = memImage.ToArray();
IPEndPoint endPoint = new IPEndPoint(this.theIP,651); //this.theIP = my IP
socket.Connect(endPoint);
socket.Send(data,0,data.Length,SocketFlags.None);

//Recieving

IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse("..my Ip.."),651);
this.socket.Bind(endPoint);
this.socket.Listen(10);
Socket connected = socket.Accept();
byte[] byteResponse = new byte[1024];
connected.Receive(byteResponse,SocketFlags.None);
MemoryStream memory = new MemoryStream(byteResponse);
Bitmap bmp = new Bitmap(memory); //generates invalid argument exception
this.pictureBox1.Image = bmp;

Could anyone help me and also point out my errors here, I would be a great help, thanks in advanced.Smile | :)
P.S. I really would prefer a method that would work in the Compact Framework, since I am working with a Pocket PC as a reciever.Smile | :)
AnswerRe: How to change from Byte[] to Bitmap on a Pocket PC Pin
Baris Kurtlutepe23-Apr-04 1:09
Baris Kurtlutepe23-Apr-04 1:09 
GeneralRe: How to change from Byte[] to Bitmap on a Pocket PC Pin
Heath Stewart23-Apr-04 2:40
protectorHeath Stewart23-Apr-04 2:40 
Questionincluding undefined data in a .net exe?? Pin
Paolo Ponzano22-Apr-04 19:01
Paolo Ponzano22-Apr-04 19:01 
AnswerRe: including undefined data in a .net exe?? Pin
Corinna John22-Apr-04 20:42
Corinna John22-Apr-04 20:42 
GeneralRe: including undefined data in a .net exe?? Pin
Paolo Ponzano23-Apr-04 6:54
Paolo Ponzano23-Apr-04 6:54 
GeneralRe: including undefined data in a .net exe?? Pin
Corinna John23-Apr-04 7:54
Corinna John23-Apr-04 7:54 
GeneralRe: including undefined data in a .net exe?? Pin
Paolo Ponzano23-Apr-04 7:56
Paolo Ponzano23-Apr-04 7:56 
GeneralRe: including undefined data in a .net exe?? Pin
Paolo Ponzano23-Apr-04 21:21
Paolo Ponzano23-Apr-04 21:21 
GeneralRe: including undefined data in a .net exe?? Pin
Corinna John24-Apr-04 8:19
Corinna John24-Apr-04 8:19 
QuestionHow to convert a number to a string Pin
karied22-Apr-04 17:24
karied22-Apr-04 17:24 
AnswerRe: How to convert a number to a string Pin
Jay Shankar22-Apr-04 22:01
Jay Shankar22-Apr-04 22:01 
AnswerRe: How to convert a number to a string Pin
Dave Kreskowiak23-Apr-04 0:30
mveDave Kreskowiak23-Apr-04 0:30 
AnswerRe: How to convert a number to a string Pin
Ryzhiy23-Apr-04 1:38
Ryzhiy23-Apr-04 1:38 
AnswerRe: How to convert a number to a string Pin
Heath Stewart23-Apr-04 2:43
protectorHeath Stewart23-Apr-04 2:43 
QuestionUndo Redo option? Pin
azusakt22-Apr-04 16:02
azusakt22-Apr-04 16:02 
AnswerRe: Undo Redo option? Pin
Christian Graus22-Apr-04 16:14
protectorChristian Graus22-Apr-04 16:14 
GeneralRe: Undo Redo option? Pin
azusakt22-Apr-04 16:24
azusakt22-Apr-04 16:24 

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.