Hi Aimee,
thanks for your post. The intention is to modify some buyes of the file before drawing it on the screen. Has this make it more clear?
User Profile
Collapse
-
Thanks Christian,
It seems that my question wasn't clear enough.
I need to have the whole content of the file in Stream format because then I can pass it to a bitmap like this:
File.Open doean't retrun a stream that contain the content of the whole file.Code:Bitmap Origbmp = new Bitmap(fileInStream);
Leave a comment:
-
how to read the whole file directly to a stream?
I know that I can read the whole file into a byte array and then convert the array to a stream using the following two lines:
But this is not efficient for my code (my code should be very fast and memory efficient). Is there any way to do this straight away without a conversion? or any other better way?Code:byte[] fileInBytes = File.ReadAllBytes(Filename); Stream fileInStream = new MemoryStream(fileInBytes);
-
How to draw an image very fast from a file in the stream format?
Hi there,
I would like to display thousands of image files on the screen. I am using the following code to display them:
Bitmap Origbmp = new Bitmap(Filename );
bmp = new Bitmap(Origbmp. Width, Origbmp.Height, PixelFormat.For mat32bppArgb);
Graphics gr = Graphics.FromIm age(bmp);
gr.DrawImage(Or igbmp, 0, 0, Origbmp.Width, Origbmp.Height) ;
but now the files are in... -
-
How to show the console contents in a Window Form?
Does anybody has any idea how to listen to the console and show its contents in a Windows Form Application?
No activity results to display
Show More
Leave a comment: