cannot use method Image.FromStream in CF?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In my project, FromStream is not supported in Image class.
I have installed the CF SP3, should I copy some unrecognizable file from the
CAB package manually?

Or I should use some alternative way?

thanks
 
thank you first.
But I actually don't know how to use the "constructor" you mentioned.
Could you please paste a sample(one or two lines) so that I can save time
searching it.

thanks!
 
The image from the stream is a JPG format,
it can still be assigned to Bitmap?
thanks!
forgive my dummy question
 
Using the constructor overload that takes a Stream simply means passing in
the Stream object when you're creating the Bitmap. Here's a sample in
VB.Net.

Imports System.IO
Imports System.Reflection

....

Dim s As Stream =
[Assembly].GetExecutingAssembly().GetManifestResourceStream("DefaultNamespac
e.Image.jpg")
Dim b As New Bitmap(s) ' Constructor overload that takes a Stream.
' Do something with the bitmap.
b.Dispose()
 
Back
Top