Loading...

mouseupcontrol position in viewer used in imaging

Support for GdViewer OCX and GdViewer Pro ActiveX/SDK.

mouseupcontrol position in viewer used in imaging

Postby rjhaleymd » Fri Jan 16, 2009 10:30 pm

Loic,
I am having problems:
I pass the e.x and e.y values returned in the mouseupcontrol event in a Viewer object to and imaging object. I want the user to click on the spot to add the second image and some text.
This worked in VB6, can't get it to work in VB.Net
The image and text do NOT end up where I click the Viewer object and the passed e.x and e.y values do not seem to correlate with where that pixel should be in the viewer (e.g. I check the image height and width, and clicking in bottow right does not return e.x and e.y anywhere near the bottom right pixel count)
THanks.


Code: Select all
    Private Sub AxGdViewer1_MouseControlUp(ByVal sender As Object, ByVal e As AxGdPicturePro5.__GdViewer_MouseUpControlEvent) Handles AxGdViewer1.MouseUpControl
        Dim strFN As String = Merge.SignFax(AxGdViewer1.GetNativeImage, "username",  "" , e.x, e.y) "
    End Sub

    Function SignFax(ByVal strFaxFN As String, ByVal strMDFolder As String, ByVal strRxText As String, ByVal iSignLeft As Long, ByVal iSignTop As Long) As String
        Dim nARGBWhiteColor As Integer
        Dim nImageID1 As Long, nImageID2 As Long
        Dim iImage1Width As Long, iImage1Height As Long
        Dim Imaging1 As New GdPicturePro5.cImaging
        Dim dFaxDate As Date = Now
 
 
        Imaging1.SetLicenseNumber(mylicensenumber)   

 
        nARGBWhiteColor = Imaging1.argb(255, 255, 255, 255)
 
       Imaging1.CreateImageFromFile("N:\RMGData\Signatures\rhaley\Signature.tif")       
 
        Call Imaging1.ConvertTo32BppARGB()
        nImageID1 = Imaging1.GetNativeImage
        Imaging1.SetTransparencyColor(nARGBWhiteColor)
        iImage1Width = Imaging1.GetWidth
        iImage1Height = Imaging1.GetHeight
 
 
            Imaging1.SetNativeImage(strFaxFN)
 
     'This draws image
        Call Imaging1.DrawImage(nImageID1, iSignLeft, iSignTop, iImage1Width, iImage1Height)
    'This adds text
        Call Imaging1.DrawText(dFaxDate.ToString, iSignLeft, iSignTop + iImage1Height, 12)           

        Imaging1.SaveAsTIFF("N:\outboundRxs\" & GetFileBaseName(strFaxFN) & ".Tif")
Emd Function
rjhaleymd
 
Posts: 10
Joined: Fri Nov 16, 2007 4:06 pm

Re: mouseupcontrol position in viewer used in imaging

Postby Loïc » Fri Jan 16, 2009 11:57 pm

Hi,

Try to replace

Code: Select all
e.x, e.y


by

Code: Select all
AxGdViewer1.GetMouseX(), e.AxGdViewer1.GetMouseY()



Best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: mouseupcontrol position in viewer used in imaging

Postby rjhaleymd » Sat Jan 17, 2009 2:23 am

will give that a try
wow, you're quick! sorry to disturb Saturday, did not expect a reply so quickly.
rjhaleymd
 
Posts: 10
Joined: Fri Nov 16, 2007 4:06 pm

Re: mouseupcontrol position in viewer used in imaging

Postby rjhaleymd » Sat Jan 17, 2009 2:49 am

:D
Perfect, Thanks a lot
rjhaleymd
 
Posts: 10
Joined: Fri Nov 16, 2007 4:06 pm

Re: mouseupcontrol position in viewer used in imaging

Postby Loïc » Sat Jan 17, 2009 1:34 pm

You are welcome !

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdViewer [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest