?
Solved

Display bmp in picture box in C#

Posted on 2013-05-19
5
Medium Priority
?
607 Views
Last Modified: 2013-05-20
Hey guys!!

I have a C# application in which I would like to display a signature that is stored in a bmp file.
The signature is in \\CAKPOSSERVER\C\POSiTrack\Sigs.  The file name would be SIG_450566 or some other number matching a transaction number.  I would like to display this signature in a picture box on a form that is opened to show all the information from transaction number 450566 or some other transaction selected in a list or by keying 450566 in a text box and pressing enter.  This would display the transaction form along with the signature.

Thanks guys!!

Jerry
0
Comment
Question by:JDL129
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 1000 total points
ID: 39179388
Try something like...
        private void button1_Click(object sender, EventArgs e)
        {
            string folder = @"\\CAKPOSSERVER\C\POSiTrack\Sigs";
            string bmpName = "SIG_" + textBox1.Text + ".bmp";
            string FileName = System.IO.Path.Combine(folder, bmpName);
            if (System.IO.File.Exists(FileName))
            {
                try
                {
                    using (Image img = Image.FromFile(FileName))
                    {
                        pictureBox1.Image = new Bitmap(img);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("File: " + FileName + Environment.NewLine + ex.ToString(), "Error Opening Image");
                }
            }
            else
            {
                MessageBox.Show("File: " + FileName, "File Not Found");
            }
        }

Open in new window

0
 

Author Comment

by:JDL129
ID: 39179785
Idle_Mind!!!!

You're the MAN!!!

thanks,

Jerry
0
 

Author Closing Comment

by:JDL129
ID: 39179786
Excellent!!!
0
 

Author Comment

by:JDL129
ID: 39181809
Idle_Mind!!!

You are awsome!!  I think I should award you more points!!

Thanks again,
Jerry
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 39181830
Uh...no problem.  =)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

770 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