convert image to Byte
-
Image img; DataPhoto = new Byte[File.ContentLength]; img=Image.FromStream(DataPhoto); the above code convert Byte to Image my quastion how to convert image to Byte ???
Palestine
-
Image img; DataPhoto = new Byte[File.ContentLength]; img=Image.FromStream(DataPhoto); the above code convert Byte to Image my quastion how to convert image to Byte ???
Palestine
-
Create a MemoryStream object and use the Image.Save to save the image data to the MemoryStream. Then read the contents of the MemoryStream into a byte array by calling its ToArray method. Paul
can u give me example ?
Palestine
-
can u give me example ?
Palestine
MemoryStream ms = new MemoryStream(); img.Save(ms); byte[] bytes = ms.ToArray();
-
can u give me example ?
Palestine
If you close the MemoryStream as per the other user's example code, you might get the same GDI+ exception. Best is to use it in a 'using' construct.
**
xacc.ide-0.2.0.77 - now with C# 3.5 support and Navigation Bar!^
New xacc.ide release RSS feed^**
-
If you close the MemoryStream as per the other user's example code, you might get the same GDI+ exception. Best is to use it in a 'using' construct.
**
xacc.ide-0.2.0.77 - now with C# 3.5 support and Navigation Bar!^
New xacc.ide release RSS feed^**
please need example to know what u mean exactly ..
Palestine
-
please need example to know what u mean exactly ..
Palestine
Normally, CLR (Common Language Runtime) manages garbage collections. But in certain situation there is a need to release the resources used by the object(s) as soon as possible. For this purpose, using statement can be used. According to MSDN:
The using statement allows the programmer to specify when objects that use resources should release them. The object provided to the using statement must implement the **IDisposable** interface. This interface provides the **Dispose** method, which should release the object's resources. A using statement can be exited either when the end of the using statement is reached or if an exception is thrown and control leaves the statement block before the end of the statement.
For the examples, see msdn[^] Regards.________________________________ Success is not something to wait for, its something to work for.