-
Mar 22nd, 2017, 05:49 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Can I copy chart control graph to clipboard?
Hi,
I have a chart control (chtReport) and once it generates the graph, I'd like to copy the graph to the clipboard using a form button (see attached).
I can only find examples of copying plain text to the clipboard but nothing for a report.
Cheers,
J
-
Mar 22nd, 2017, 06:03 PM
#2
Re: Can I copy chart control graph to clipboard?
Would an image (of the chart) be ok?
I think that's the best you can hope for.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 22nd, 2017, 06:11 PM
#3
Thread Starter
Addicted Member
Re: Can I copy chart control graph to clipboard?
Hi mate,
Many thanks for your reply!
Yes, I suspect that would be more than fine! I've been looking at an example here:
Can you please tell me what I should be searching for? I take it (as per the link above) I can do something with the image returned value from the GetChartImage function?
Cheers,
J
-
Mar 22nd, 2017, 06:12 PM
#4
Re: Can I copy chart control graph to clipboard?
To save to the clipboard as an image...
Code:
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
'save image
Dim img As New Bitmap(chtReport.Width, chtReport.Height)
Dim gr As Graphics = Graphics.FromImage(img)
gr.Clear(Color.White)
chtReport.Printing.PrintPaint(gr, New Rectangle(Point.Empty, chtReport.Size))
Clipboard.SetImage(img)
End Sub
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 22nd, 2017, 06:17 PM
#5
Thread Starter
Addicted Member
Re: Can I copy chart control graph to clipboard?
Thanks, Paul!
Worked a treat my friend. You're a legend
Many thanks,
J
-
Mar 22nd, 2017, 06:19 PM
#6
Re: [RESOLVED] Can I copy chart control graph to clipboard?
I'm assuming it's a System.Windows.Forms.DataVisualization.Charting.Chart
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 22nd, 2017, 06:24 PM
#7
Thread Starter
Addicted Member
Re: [RESOLVED] Can I copy chart control graph to clipboard?
yip
-
Mar 22nd, 2017, 06:35 PM
#8
Re: [RESOLVED] Can I copy chart control graph to clipboard?
Our posts crossed over there. But all is well that ends well.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
May 25th, 2020, 03:41 AM
#9
New Member
Re: Can I copy chart control graph to clipboard?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|