|
outBMP2 |
Posted by Francisco Caycedo on May-28-2014 09:15 |
|
Hello, I am a new user and would like to get some help on how to copy to memory a bmp of
an existing chart.
I have been researching and know that outBMP2 is designed to do that, but I dont know
how to call this function, because is not available for cd. or ChartViewer.
Any help would be apprecited.
Thanks! |
Re: outBMP2 |
Posted by Peter Kwan on May-28-2014 17:59 |
|
Hi Francisco,
Since you mentioned about "cd" and "ChartViewer", I assume you are using "ChartDirector
for ASP/COM/VB" in a VB6 development environment.
For a chart object, you can use the higher level API BaseChart.makeChart2. For example:
Dim myBMP() As Byte
myBMP = c.makeChart2(cd.BMP)
Hope this can help.
Regards
Peter Kwan |
Re: outBMP2 |
Posted by Francisco Caycedo on May-28-2014 22:33 |
|
Hi Peter,
Thanks for your prompt answer.
Yes, I am using VB6.
From your note I understand that I have to call the routine that creates the chart using
makeChart2 to output the chart in bmp format. If this is correct, I implemented at the end
of my "createChart" routine the following code:
Dim myBMP() as Byte
myBMP=c.makeChar2(cd.BMP)
Clipboard.Clear
Clipboard.SetData myBMP, vbCFBitmat
But all what is copied to the clipboard is "myBMP" string.
Regards,
Francisco |
Re: outBMP2 |
Posted by Peter Kwan on May-28-2014 23:02 |
|
Hi Francisco,
According to VB6 documentation, the Clipboard expects a Picture object. not just a memory
representation of the BMP. So the code should be:
Clipboard.SetData c.makePicture()
If you are using the ChartViewer to display the chart, you can obtain the Picture object
from the ChartViewer as well:
Clipboard.SetData ChartViewer1.Picture
Hope this can help.
Regards
Peter Kwan |
Re: outBMP2 |
Posted by Francisco Caycedo on May-28-2014 23:06 |
|
Hi Peter,
I tried the last option and works perfect.
Thanks for your help!
Regards,
Francisco |
|