how to print only the visible part of the displayed image

Discussions about document viewing.
Post Reply
astva
Posts: 12
Joined: Fri Sep 21, 2007 10:15 am

how to print only the visible part of the displayed image

Post by astva » Fri Sep 21, 2007 12:03 pm

vb6
how to print only that part of image, which is visible on the window of GdViewer ? :?: :!:

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Fri Sep 21, 2007 12:40 pm

Like that:

Code: Select all

Dim oGdPicture As New GdpicturePro.cGdPicture
Dim nImageID As Long

nImageID = oGdPicture.CreateImageFromHwnd(oGdViewer.hWnd)
oGdPicture.SetNativeImage (nImageID)
oGdPicture.PrintImage

Regards,

Loïc

astva
Posts: 12
Joined: Fri Sep 21, 2007 10:15 am

Post by astva » Fri Sep 21, 2007 1:26 pm

I have GdViewer only

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Fri Sep 21, 2007 1:47 pm

So you can do like that:

Code: Select all

Dim nLeft As Long, nTop As Long, nHeight As Long, nWidth As Long

Call oGdViewer.GetDisplayedArea(nLeft, nTop, nWidth, nHeight)
Call oGdViewer.CopyRegion2Clipboard(nLeft, nTop, nWidth, nHeight)
Call oGdViewer.DisplayFromClipboardData
Call oGdViewer.PrintImage

astva
Posts: 12
Joined: Fri Sep 21, 2007 10:15 am

Post by astva » Fri Sep 21, 2007 1:56 pm

ok! :D

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest