Click here to Skip to main content
15,917,005 members
Home / Discussions / C#
   

C#

 
QuestionCrystal report print by coding Pin
KIDYA23-May-09 2:12
KIDYA23-May-09 2:12 
AnswerRe: Crystal report print by coding Pin
_Maxxx_24-May-09 16:59
professional_Maxxx_24-May-09 16:59 
QuestionHow to move a drawn ball by Threading? Pin
pcsience23-May-09 0:01
pcsience23-May-09 0:01 
AnswerRe: How to move a drawn ball by Threading? Pin
Douglas Troy23-May-09 7:03
Douglas Troy23-May-09 7:03 
QuestionPrerequisites Pin
Ashwani Dhiman22-May-09 23:46
Ashwani Dhiman22-May-09 23:46 
QuestionRe: Prerequisites Pin
harold aptroot22-May-09 23:56
harold aptroot22-May-09 23:56 
AnswerRe: Prerequisites Pin
Ashwani Dhiman23-May-09 0:20
Ashwani Dhiman23-May-09 0:20 
QuestionKilling proccesses programatically Pin
Rajdeep.NET is BACK22-May-09 23:17
Rajdeep.NET is BACK22-May-09 23:17 
AnswerRe: Killing proccesses programatically Pin
dan!sh 22-May-09 23:33
professional dan!sh 22-May-09 23:33 
GeneralRe: Killing proccesses programatically Pin
Mycroft Holmes23-May-09 2:02
professionalMycroft Holmes23-May-09 2:02 
AnswerRe: Killing proccesses programatically Pin
0x3c023-May-09 2:37
0x3c023-May-09 2:37 
JokeRe: Killing proccesses programatically Pin
dan!sh 23-May-09 5:32
professional dan!sh 23-May-09 5:32 
GeneralRe: Killing proccesses programatically Pin
Luc Pattyn23-May-09 5:44
sitebuilderLuc Pattyn23-May-09 5:44 
JokeRe: Killing proccesses programatically Pin
0x3c023-May-09 6:12
0x3c023-May-09 6:12 
QuestionGrab an image on memory Pin
Massimo Barbon22-May-09 21:49
Massimo Barbon22-May-09 21:49 
AnswerRe: Grab an image on memory Pin
beatles169223-May-09 1:37
beatles169223-May-09 1:37 
You can use a byte array to save any binary files in memory.
If you are dealing with an System.Drawing.Image object I suggest you serialize it into a memory stream,get memory stream buffer and let the memory stream go.

<br />
byte[] myImage;<br />
using(var ms=new MemoryStream())<br />
{<br />
var bf=new BinaryFormatter();<br />
bf.Serialize(ms,theImage);<br />
myImage=ms.GetBuffer();<br />
ms.Close();<br />
}<br />


You can use a BinaryFormatter again to deserialize myImage into an Image object.

<br />
Image theImage;<br />
using(var ms=new MemoryStream(myImage))<br />
{<br />
var bf=new BinaryFormatter();<br />
theImage=(Image)bf.Deserialize(ms);<br />
ms.Close();<br />
}<br />


Note : System.Draw.Image is serializable so we can serialize and deserialize it .To use the same method on nonserializable objects there should be a way to write content of the image into a memory stream.
Questionhow to update gridview? Pin
priya1515s22-May-09 21:09
priya1515s22-May-09 21:09 
AnswerRe: how to update gridview? Pin
noorahmad22-May-09 21:49
noorahmad22-May-09 21:49 
AnswerRe: how to update gridview? Pin
Mycroft Holmes22-May-09 21:49
professionalMycroft Holmes22-May-09 21:49 
Questionspecial thread from monitor Pin
shahin gholami22-May-09 20:35
shahin gholami22-May-09 20:35 
AnswerRe: special thread from monitor Pin
Manas Bhardwaj22-May-09 22:46
professionalManas Bhardwaj22-May-09 22:46 
GeneralRe: special thread from monitor Pin
shahin gholami23-May-09 2:48
shahin gholami23-May-09 2:48 
QuestionProblem while loading the form Pin
lnmca22-May-09 18:57
lnmca22-May-09 18:57 
AnswerRe: Problem while loading the form Pin
Mycroft Holmes22-May-09 21:45
professionalMycroft Holmes22-May-09 21:45 
QuestionCrystal controle in C#.net Pin
KIDYA22-May-09 18:55
KIDYA22-May-09 18:55 

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.