FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Image ( with Scrollbars ) nRow/nCol-pos. on Mouseclick ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Image ( with Scrollbars ) nRow/nCol-pos. on Mouseclick ?

Posted: Wed Aug 03, 2011 12:31 PM
Hello,

I have a Problem, getting nRow, nCol-position on Images with Scrollbars
nRow and nCol are always related to Screen and not to the Image.
For Image-cropping I want to fill 4 Gets with Top, Left, Bottom and Right ( Results from 2 Mouseclicks ).

Top Image



Scrolling to Bottom, the Mouseclicks are returning wrong Values.



Using Images with Size completely visible on Screen, no Problem.
( the Results from 2 Mouseclicks for Top / Teft and Bottom / Right )



Code (fw): Select all Collapse
// uses a Counter on Image-click
// the Counter starts with Value 1 for Top / left
// Reset to 1 ( Top / Left ), the Counter reaches Value 3 
// ---------------------------------------------------------------
// oBmp:bLClicked := {|nRow,nCol| ( nCounter ++, GET_VALUES(nRow,nCol) ) }

// --------------------------

FUNCTION GET_VALUES(nRow,nCol)
IF nCounter = 3 // Reset
      nCounter := 1
ENDIF
IF nCounter = 1 // 1. Click = Top / left
      nCropT := nRow // Top
      nCropL := nCol // Left
      nCropW := 0 // Right
      nCropH := 0 // Bottom
ENDIF
IF nCounter = 2 // 2. Click = Bottom / Right
      nCropW := nCol // Right
      nCropH := nRow // Bottom
ENDIF

oGet5:Refresh()
oGet7:Refresh()
oGet6:Refresh()
oGet8:Refresh() 

RETURN( NIL )


The same used, to define the Watermark-position on Mouseclick
( but only works inside the nonscrolled-area )

There are many predefined positions ( all are working fine )
top-left
top-center
top-right
center-left
center
center-right
bottom-left
bottom-center
bottom-right





Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion