Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hello,

 

Im tryin to save a mschart object to a picture. I decided to copy the chart to the clipboard and then from the clipboard to a picturebox where i would save the picture as an image file. What i have tried is below. I found someone elses example which didnt work at all but i had a rehash so the code which is below has been mashed around a bit. Does anyone know where im going wrong? i just cant see it. Cheers for any pointers.

 

       Dim cmdlg1 As New SaveFileDialog
       Dim filename As String
       cmdlg1.ShowDialog()
       filename = cmdlg1.FileName
       AxMSChart1.EditCopy()
       Dim piccy As New PictureBox
       piccy.Image = Clipboard.GetDataObject.GetData(DataFormats.EnhancedMetafile)
       Dim something As New Drawing.Imaging.ImageFormat(Guid.NewGuid)
       something = Imaging.ImageFormat.Emf
      
       Application.DoEvents()
       Dim Images As Image
       Images = piccy.Image
       Images.Save(filename)

 

Cheers folks

 

Chris

Chris

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...