Solved

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

Posted on 2006-11-08
3
312 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
[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 Comments
 
LVL 6

Expert Comment

by:Roopesh_7
ID: 17902393
0
 
LVL 86

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

726 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