Hello,
I am trying to use the CopyToClipboard() function on the GdPictureImaging object as follows but noticed when dealing with PDFs the image copied is from somewhere else in the PDF as if the coordinates aren't matching up somewhere. Things seem to work just fine with image files though. Am I doing something wrong?
Code for opening file:
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
m_Filename = OpenFileDialog1.FileName
If m_Filename.EndsWith("pdf") Then
status = GdViewer1.DisplayFromFile(m_Filename)
m_ImageID = GdViewer1.PdfRenderPageToGdPictureImage(72, 1)
Else
m_ImageID = oGdPictureImaging.CreateGdPictureImageFromFile(m_Filename)
GdViewer1.DisplayFromGdPictureImage(m_ImageID)
End If
End If
Code for copying to clipboard using the selected area on the GdViewer object:
Dim left, top, width, height As Integer
GdViewer1.GetRectCoordinatesOnDocument(left, top, width, height)
oGdPictureImaging.CopyRegionToClipboard(m_ImageID, left, top, width, height)
