Click here to Skip to main content
15,910,009 members
Home / Discussions / C#
   

C#

 
AnswerRe: thread question Pin
Leslie Sanford21-Mar-07 17:02
Leslie Sanford21-Mar-07 17:02 
QuestionProgram structure need experienced programmers perspective please Pin
Mischievious21-Mar-07 14:36
Mischievious21-Mar-07 14:36 
AnswerRe: Program structure need experienced programmers perspective please Pin
Leslie Sanford21-Mar-07 17:05
Leslie Sanford21-Mar-07 17:05 
GeneralRe: Program structure need experienced programmers perspective please Pin
Mischievious21-Mar-07 18:14
Mischievious21-Mar-07 18:14 
QuestionQuestion about Windows Media Encoder Pin
Julianne_juju21-Mar-07 14:11
Julianne_juju21-Mar-07 14:11 
QuestionNeed help with XML config file Pin
Mark F.21-Mar-07 13:40
Mark F.21-Mar-07 13:40 
AnswerRe: Need help with XML config file Pin
coolestCoder21-Mar-07 18:31
coolestCoder21-Mar-07 18:31 
QuestionTrouble converting byte[] to bmp..... Pin
Are Jay21-Mar-07 12:17
Are Jay21-Mar-07 12:17 
<br />
<span style="color: #0000FF;">public static</span>  Bitmap BytesToBmp( <span style="color: #0000FF;">byte</span>[] b, <span style="color: color: #00CC99;">Size</span> imageSize )<br />
{<br />
<div style="padding-left: 5px;"><br />
<span style="color: #009933;">// Open a stream for the image and write the bytes into it</span><br />
</div><br />
<div style="padding-left: 5px;"><br />
<span style="color: color: #00CC99;">MemoryStream</span> stream = <span style="color: #0000FF;">new</span> <span style="color: color: #00CC99;">MemoryStream</span>( b, <span style="color: #0000FF;">true</span> );    <br />
</div><br />
<div style="padding-left: 5px;"><br />
stream.Write( b, 0, b.Length ); <br />
</div><br />
<div style="padding-left: 5px;"><br />
<span style="color: #009933;">// Create a bitmap from the stream</span><br />
</div><br />
<div style="padding-left: 5px;"><br />
<span style="color: color: #00CC99;">Bitmap</span> bmp = <span style="color: #0000FF;">new</span> <span style="color: color: #00CC99;">Bitmap</span>( stream ); <br />
</div><br />
<div style="padding-left: 5px;"><br />
stream.Close(); <br />
</div><br />
<div style="padding-left: 5px;"><br />
bmp = <span style="color: #0000FF;">null</span>; <br />
</div><br />
<div style="padding-left: 5px;"><br />
<span style="color: #0000FF;">return new</span> <span style="color: color: #00CC99;">Bitmap</span>( bmp, imageSize ); <br />
</div><br />
}<br />


I'm getting an error: System.ArgumentException: Parameter is not valid.
Then when I use the Stream Object I get:
Cannot create an instance of the abstract class or interface 'System.IO.Stream'.
I'm at a lose on how to create a Bitmap from a Stream if I can not create a Stream.
I was under the impression that a derived class such as: MemoryStream would work.
Any help explaining this would be helpful.
Thanks.



I'm listening but I only speak GEEK.

AnswerRe: Trouble converting byte[] to bmp..... Pin
Nick Hodapp21-Mar-07 12:44
sitebuilderNick Hodapp21-Mar-07 12:44 
GeneralRe: Trouble converting byte[] to bmp..... Pin
Are Jay22-Mar-07 3:23
Are Jay22-Mar-07 3:23 
AnswerRe: Trouble converting byte[] to bmp..... Pin
Colin Angus Mackay21-Mar-07 13:00
Colin Angus Mackay21-Mar-07 13:00 
GeneralRe: Trouble converting byte[] to bmp..... Pin
Are Jay22-Mar-07 3:13
Are Jay22-Mar-07 3:13 
AnswerRe: Trouble converting byte[] to bmp..... Pin
Are Jay22-Mar-07 11:23
Are Jay22-Mar-07 11:23 
QuestionART network with c# Pin
pariisa21-Mar-07 11:21
pariisa21-Mar-07 11:21 
AnswerRe: ART network with c# Pin
Stefan Troschuetz21-Mar-07 11:57
Stefan Troschuetz21-Mar-07 11:57 
Questionbitmap lock flag or something like it Pin
haseeb_saeed21-Mar-07 10:21
haseeb_saeed21-Mar-07 10:21 
QuestionDataGridView Pin
aranhamarvel21-Mar-07 9:28
aranhamarvel21-Mar-07 9:28 
AnswerRe: DataGridView Pin
KaineDunno21-Mar-07 21:19
KaineDunno21-Mar-07 21:19 
GeneralRe: DataGridView Pin
aranhamarvel22-Mar-07 2:25
aranhamarvel22-Mar-07 2:25 
QuestionReports in letterform Pin
joon vh.21-Mar-07 9:23
joon vh.21-Mar-07 9:23 
QuestionStreamReader.Write("Replace existing text entirly"); Pin
Muammar©21-Mar-07 8:19
Muammar©21-Mar-07 8:19 
AnswerRe: StreamReader.Write("Replace existing text entirly"); Pin
Dave Kreskowiak21-Mar-07 8:45
mveDave Kreskowiak21-Mar-07 8:45 
GeneralRe: StreamReader.Write("Replace existing text entirly"); Pin
Muammar©21-Mar-07 8:56
Muammar©21-Mar-07 8:56 
AnswerRe: StreamReader.Write("Replace existing text entirly"); Pin
Stefan Troschuetz21-Mar-07 8:46
Stefan Troschuetz21-Mar-07 8:46 
GeneralRe: StreamReader.Write("Replace existing text entirly"); Pin
Muammar©21-Mar-07 9:09
Muammar©21-Mar-07 9:09 

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.