how to print mschart

mary

Member
Joined
Aug 28, 2006
Messages
6
Programming Experience
Beginner
hi
i want to print that chart alone. so that i used the following code.
Clipboard.Clear()
mchart1.EditCopy()
Dim chartcapture As Bitmap
Dim iData As IDataObject
iData=Clipboard.GetDataObject
If iData.GetDataPresent(DataFormats.Bitmap) Then
chartcapture = CType(iData, Bitmap)
End If
e.Graphics.DrawImage(chartcapture, 8, 80)


i just copy the chart into clipboard and then convert it into bitmap and then i printed that bitmap.

This is working in vs.net 2003 but it is not working in vs.net 2005 one fatal error is coming.

The error is

The runtime has encountered a fatal error. The address of the error was at 0x7a005c3d, on thread 0x988. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

What is the problem? can u able to rectify it? please...
 
I'm probably not much help but look into finding a way to print the
mchart1 besides using a clipboard capture. I think the quality isn't the best
this way also.
 

Latest posts

Back
Top