|
-
January 27th, 2003, 09:20 AM
#1
Image class and Stream class
I have an array of gray level bytes I want to show on screen. In order to do that I use Stream and Image classes like the following:
Stream strm;
Image img;
Graphics grfx;
strm.Write(pByteArray,0,nSize);
img = Image.FromStream(strm);
grfx.DrawImage(0,0,width,height);
But I get an error saying:
Use of unassigned local variable strm in the statement
img = Image.FromStream(strm);
What have I done wrong?
-
January 27th, 2003, 11:17 AM
#2
make use of MemoryStream instead and make an instance of it first and then use it.
since Stream is an abstract class you can't make instance i.e. you can't do new of it.
Paresh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|