The approach with stream is not correct.
See here https://stackoverflow.com/a/8701748/355264
Correct code from above link:
Image img;
using (var bmpTemp = new Bitmap("image_file_path"))
{
img = new Bitmap(bmpTemp);
}
More Related Contents:
- Load image from resources area of project in C#
- How do I rotate a picture in WinForms
- Zoom and translate an Image from the mouse location
- How to crop a polygonal area from an image in a WinForm pictureBox? [closed]
- Loading image from code using relative path in Windows Forms
- Placing Images and Strings with a C# Combobox
- How can I capture as bitmap only what a picturebox is displaying, without using “copy from screen”?
- Saving image to file
- How can I add transparency to a c# form while keeping controls visible?
- How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?
- How to get ALL child controls of a Windows Forms form of a specific type (Button/Textbox)?
- Visual Studio 2010 suddenly can’t see namespace?
- How to get an HtmlElement value inside Frames/IFrames?
- Passing variable between winforms
- Generic base class for WinForm UserControl
- How expensive is the lock statement?
- Does lock() guarantee acquired in order requested?
- WinForms Global Exception Handling?
- WinForms RadioButtonList doesn’t exist?
- Get access to parent control from user control – C#
- Why does the lock object have to be static?
- When is ReaderWriterLockSlim better than a simple lock?
- SendInput doesn’t perform click mouse button unless I move cursor
- How to programmatically include a file in my project?
- Reading data from DataGridView in C#
- Graphics on indexed image
- Process.Start(url) fails
- Winforms : How to bind the Checkbox item of a CheckedListBox with databinding
- Passing object to different windows forms
- Winforms : Intercepting Mouse Event on Main Form first, not on Controls