Solved

How can I image load from file to PictureBox

Posted on 2004-04-27
2
1,588 Views
Last Modified: 2012-06-27
Hi,

I am trying load an image from file to PictureBox

How can I load an image from file to PictureBox but on .Net Compact Framework

Example:

filename = " c:\picture.jpg "
PictureBox1.Image = Image.FromFile(filename)

Error :
'FromFile' is not a member 'System.Drawing.Image'.

Thanks for your help.
0
Comment
Question by:Obsolate
2 Comments
 
LVL 7

Accepted Solution

by:
OHDev2004 earned 50 total points
ID: 10927127
try this :

 Dim MyImage As Bitmap
  If Not (MyImage Is Nothing) Then
    MyImage.Dispose()
  End If
 Image1.SizeMode = PictureBoxSizeMode.AutoSize
 filename = " c:\picture.jpg "
 MyImage = New Bitmap((filename))
 Image1.Image = CType(MyImage, Image)

this will load the image from filename into Image1 ,, :P
OHDev2004
0
 

Expert Comment

by:ryanb_9f_com
ID: 11265789
how would I do the same as an if a randomly gernerated number was a given value for a black jack game?  I am using Visual Basic in Visual Studio .Net 2003 Acidemic Edition
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now