open an image file

Posted on 2004-11-21
Last Modified: 2010-04-15

Is it possible to open an image file using c#, if yes, can someone provides the syntax.

Question by:mfcseeker
    LVL 22

    Accepted Solution


    it's very simple, just add PictureBox control on the form and use this

          pictureBox1.Image = new Bitmap("c:\\pic.bmp");

    LVL 11

    Assisted Solution

    can be done using

    System.Drawing.Image img = System.Drawing.Image.FromFile(@"c:\pic.jpg");

    LVL 1

    Author Comment

    Thanks for both of you, it worked fine, just another simple questions....

    How can I change the colors of the image from RGB to CMYK and vice versa?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    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

    Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
    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…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    760 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