How come Image.FromFile() member function is not avaiable?

G

Gravity

Hi,

Refering to the title, I am using Visual Studio .NET 2003, WInXP Pro SP2 to
develop C# on PocketPC.

To me surprise, I cannot locate the member function, FromFile( ) from the
System.Drawing.Image class.

My VS only show 8 members functions from the class;

(1) Dispose
(2) Equal
(3) GetHashCode
(4) GetType
(5) Height
(6) Size
(7) ToString
(8) Width

There are just no FromFile( ), thus I could not load a simple image into my
picture box.

Is it my .NET framework is not configurated or installed correctly? How am I
going to know that?

Please advise. I am really confuss.
 
J

Jon Skeet [C# MVP]

Gravity said:
Refering to the title, I am using Visual Studio .NET 2003, WInXP Pro SP2 to
develop C# on PocketPC.

To me surprise, I cannot locate the member function, FromFile( ) from the
System.Drawing.Image class.

My VS only show 8 members functions from the class;

(1) Dispose
(2) Equal
(3) GetHashCode
(4) GetType
(5) Height
(6) Size
(7) ToString
(8) Width

There are just no FromFile( ), thus I could not load a simple image into my
picture box.

Is it my .NET framework is not configurated or installed correctly? How am I
going to know that?

Nothing's misconfigured - if you look at the list of members for the
Image class in MSDN, you'll see that only the above members are marked
as being supported by the Compact Framework.

You need to call a constructor of the Bitmap class instead (Bitmap
derives from Image).

The Compact Framework only supports a subset of the functionality of
the full framework.
 
G

Gravity

Thanks for the information. I understand now.

I am new to C# as my background is purely on C/C++/VC++.

What if I need to display a JPEG file? What are my options here for the
Pocket PC (compact franework?) development?

Hope can get some ideals from you.
 
J

Jon Skeet [C# MVP]

Gravity said:
Thanks for the information. I understand now.

I am new to C# as my background is purely on C/C++/VC++.

What if I need to display a JPEG file? What are my options here for the
Pocket PC (compact franework?) development?

The Bitmap class covers that too - it's not Bitmap in the sense of only
handling BMP files, it's Bitmap in terms of Windows internal ideas.
 
G

Gravity

A class named "Bitmap" that handle JPEG as well? That's cool. But I think it
should actually use other name rather than Bitmap.

Can I know where is the member class located?
 
J

Jon Skeet [C# MVP]

Gravity said:
A class named "Bitmap" that handle JPEG as well? That's cool. But I think it
should actually use other name rather than Bitmap.

Well, a JPEG is a bitmap too, in the abstract sense. The fault is
really in calling a format after a concept than naming the class after
the concept.
Can I know where is the member class located?

What exactly do you mean?
 
G

Gravity

Thank you.

Jon Skeet said:
Well, a JPEG is a bitmap too, in the abstract sense. The fault is
really in calling a format after a concept than naming the class after
the concept.


What exactly do you mean?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top