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

  • Home
  • SEARCH
  • 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 624265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:10:55+00:00 2026-05-13T19:10:55+00:00

I am learning C# as I write a program which interfaces with a spectrometer.

  • 0

I am learning C# as I write a program which interfaces with a spectrometer. I have figured out how to get a spectrum from the spectrometer and plot it on an MS chart.

How do I copy the image of the chart into the clipboard so that it can be pasted into other programs?

I’m using Visual Studio C# 2010.

I have found the chart.SaveImage method, but I would really rather copy the image to the clipboard rather than having to save it to disk. I have not found a chart.CopyPicture method.

I also figured out how to copy the raw data to clipboard as a string, which can then be pasted into an Excel worksheet and plotted, but I would rather just copy the image itself.


Additonal data:

I am able to copy the image to the clipboard using the following code:

spectrumChart2.SaveImage("Image.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
Image img = Image.FromFile("Image.jpg");
System.Windows.Forms.Clipboard.SetImage(img);

Surely there is way to get the image directly Clipboard without saving and retrieving it from a disk file first. Please, please let me know how this is done (before one of my coworkers finds this kludge)!

  • 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-05-13T19:10:55+00:00Added an answer on May 13, 2026 at 7:10 pm

    To get image from chart control, save it to memory stream, create bitmap and then send it to clipboard:

    using (MemoryStream ms = new MemoryStream())
    {
        chart1.SaveImage(ms, ChartImageFormat.Bmp);
        Bitmap bm = new Bitmap(ms);
        Clipboard.SetImage(bm);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing program which need to interact with COM ports. By learning from
I've started learning Lisp recently and wanted to write a program which uses gtk
I am trying to write a program which can calculate factorial from 1-9 by
I trying to write a PowerShell script (learning at the same time). I have
I'm write a simple graphic-based program in Assembly for learning purpose; for this, I
I need to write a program which does 2 tasks at the same time
I have a very old, very very large, fully working, C program which plays
I am trying to write a program which will allow two players to play
hi i have a cuda program which run successfully here is code for cuda
I have been thinking to implement the following program, just out of curiosity and

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.