473,382 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

FromFile is not a member of the System.Drawing.Image

PJ
Hi

I was developing a Class for skinning an application. IN order to read the
image file dynamically I used System.Drawing.Image.FromFile("..."). Strangely
VS 2003 returns an error saying that "FromFile is not a member of the
System.Drawing.Image". According to the member list under IMage class that is
not true. I am completely baffled by the behaviour and stuck from past 2
days. Can anyone please help?

I have attached the function
Public Function validateImageLoad(ByVal xmlDoc As Xml.XmlDocument, ByVal
sFolder As String, ByVal picHolderArea As PictureBox, ByVal skinImageSection
As String, ByVal imageCollection As Collection) As Boolean
Dim resourceList As Xml.XmlNodeList
Dim resourceNode As Xml.XmlNode
Dim resourceNodeChild As Xml.XmlNode

Try

resourceList = xmlDoc.GetElementsByTagName(skinImageSection)

picHolderArea.Image =
System.Drawing.Image.FromFile("d:\WINCE420\PUBLIC\ MovieEPG\Skins\main.jpg")

If (picHolderArea.Height = colImagesHeight(resourceNode.Name))
And (picHolderArea.Width = colImagesWidth(resourceNode.Name)) Then
imageCollection.Add(picHolderArea.Image, resourceNode.Name)
End If

Catch e As Exception
Console.Write("Error in validating the loading of image")
End Try

End Function

NOTE: I have updated the SDK .NET framework to 1.1 and also added the
service pack.

Thanks in advance
PJ
Nov 21 '05 #1
2 6235
* "=?Utf-8?B?UEo=?=" <PJ@discussions.microsoft.com> scripsit:
I was developing a Class for skinning an application. IN order to read the
image file dynamically I used System.Drawing.Image.FromFile("..."). Strangely
VS 2003 returns an error saying that "FromFile is not a member of the
System.Drawing.Image". According to the member list under IMage class that is
not true.


'Image.FromFile' is not supported by the .NET Compact Framework.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2
* "=?Utf-8?B?UEo=?=" <PJ@discussions.microsoft.com> scripsit:
True I was using .NET Compact framework because I was develping this app as
a smart device application. However, I tried copying the class file into a
regular exe app and still it had trouble for what ever reason.

Is there a alternative to laod pictures in .NET Compact Framework?


\\\
Dim b As New Bitmap("C:\foo.bmp")
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: tlemcenvisit | last post by:
Hello This code don't affich the image pictureBox1->Image->FromFile("c:\\image.jpg"); c:\image.jpg exists. Please, can you help me? Thanks
3
by: anastasia | last post by:
I get an out of memory exception when attempting to excecute the following code: original = System.Drawing.Image.FromFile(file.FileName,true); I ONLY get this exception when the file is in the...
2
by: Joseph | last post by:
can i create a system.drawing.Image from a url. using http://www.domain.com/image.jpg instead of c:\image.jpg. ? thanks!
8
by: bsmalik | last post by:
Hi All, I am trying to do a simple thing. ----------------------------- Dim NCImage As System.Drawing.Image = System.Drawing.Image.FromFile("NC.jpg") ---------------------------- I have the...
2
by: steve | last post by:
imports system.drawing imports system.drawing.image dim img as image = image.fromfile("a.bmp") picturebox1.image = img i'm using vs 2003 and the error i have is that fromfile is not a member...
0
by: Taiwo | last post by:
When I use the method "System.Drawing.Image.FromFile(pictureFile)" where pictureFile is the path to a valid image file, the file is locked even minutes after the statement executes. This code is in...
2
by: active | last post by:
I find Bitmap.Save works for WMF files but Bitmap.FromFile does not. If I use FromFile on a WMF file that came with VS I get an exception. If I use it on a WMF file created with Bitmap.Save I...
4
by: Darrel | last post by:
When I accept an image that has been uploaded through a form, I can grab the image type as such: imageToCheck = uploadedFileField.PostedFile imageToCheck.ContentType If (contentType =...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.