Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7792469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:11:39+00:00 2026-06-01T22:11:39+00:00

I need to display a Bitmap image in a pop-up window created by a

  • 0

I need to display a Bitmap image in a pop-up window created by a c# class library.
How is this possible?

I have tried the following:

        Bitmap img = tpv.Img();
        Graphics graphics = Graphics.FromImage(img);
        graphics.DrawImage(img, 0, 0);

and

        Bitmap img = tpv.Img();
        PictureBox pb = new PictureBox();
        pb.Size = img.Size;
        pb.Image = img;
        pb.Show();

however a window is not showing.
Is it possible to get a class library to create a pop-up window displaying a bitmap image?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:11:41+00:00Added an answer on June 1, 2026 at 10:11 pm

    Assuming WinForms, you need to add the PictureBox to a top-level Window like a Form. If you’re using WPF the concept is identical, except that you would add your picture box to a Grid or something before showing the Window.

    using (Form form = new Form()) {
        Bitmap img = tpv.Img();
    
        form.StartPosition = FormStartPosition.CenterScreen;
        form.Size = img.Size;
    
        PictureBox pb = new PictureBox();
        pb.Dock = DockStyle.Fill;
        pb.Image = img;
    
        form.Controls.Add(pb);
        form.ShowDialog();
    }
    

    Note that in my example it will show the form as modal. If you need a non-modal form call form.Show() instead and remove the using block so your form is not disposed immediately.

    However, better design pattern would be to design your class library method to return the image to your UI, and have your main UI show the image instead. A framework API should never show a UI directly like this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to display the gesture library as a bitmap images. The code below
I need to display content from an OLAP cube in Sharepoint. This could be
I need to display a list of dates, which I have in a table
I need to create a gallery type application. Where i need display many image
I am writing an Android application where I need to display Image Captured through
I have a custom listview which display an image, textview and radio button. I
I need to draw an image pixel by pixel and display it inside a
Is this possible or do I have to use WPF. I am new to
In my android app I need to display a text on an image. The
I need to download a image in a AsyncTask and display progress in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.