Solved

how to assign image to windows forms picture control at run time

Posted on 2006-11-08
3
298 Views
Last Modified: 2008-03-03
Hi,
I need sample code that show me how to assign images to picture control(or any other control I don't know)
at program runtime so that I can inser article of data that the images will be part of it.
any help is welcomed

Rgards
Hatem
0
Comment
Question by:shang3000
3 Comments
 
LVL 6

Expert Comment

by:Roopesh_7
ID: 17902393
0
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 200 total points
ID: 17902547
Simply?...

    pictureBox1.Image = Image.FromFile(@"c:\someImage.bmp");
0
 
LVL 13

Accepted Solution

by:
iHadi earned 300 total points
ID: 17904038
It depends on where your image resides:

            // from another picturebox
            pictureBox1.Image = pictureBox2.Image;

            // from a file, load the image to memory then to picturebox
            System.Drawing.Bitmap bmp = new System.Drawing.Bitmap  (@"C:\a.jpg");
            // from an image in memory
            pictureBox1.Image = bmp;

0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 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

12 Experts available now in Live!

Get 1:1 Help Now