What's Here?
- Members: 117,283
- Replies: 431,124
- Topics: 66,541
- Snippets: 2,391
- Tutorials: 630
- Total Online: 2,284
- Members: 68
- Guests: 2,216
Who's Online?
|
Welcome to Dream.In.Code |
|
|
Getting C# Help is Easy!
Join 117,283 C# Programmers for FREE! Ask your question and get quick answers from experts. There are 2,284 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!
|
|
Submitted By: gbertoli3
|
|
|
Rating:
|
|
Views: 85 |
Language: C#
|
|
Last Modified: August 7, 2008 |
Snippet
public void openBMP(String filename)
{
//Declare the OpenFileDialog as a new OpenFileDialog.
OpenFileDialog openFileDialog = new OpenFileDialog ();
//Declare the PictureBox as a new PictureBox
PictureBox picBox = new PictureBox ();
//Set the openFileDialog's Filter.
openFileDialog.Filter = "Bitmap Image|*.bmp|All Files|*.*";
//Set the openFileDialog's FileName to nothing.
openFileDialog.FileName = "";
//Show the openFileDialog
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
{
//To do code if the Open button was pressed
//Use something like:
filename = openFileDialog.FileName;
picBox.Image = Image.FromFile(filename);
}
else
{
return;
}
}
Copy & Paste
|
|
|
Reference Sheets
Bye Bye Ads
Free DIC T-Shirt
Related Sites
Monthly Drawing
Partners
Top Contributors
Top 10 Kudos This Month
|