Hi,
In TImage, I show photos. Can I draw something on top of a photo (for example, cross it out) ?
@ 450, 455 XIMAGE oImage3 SOURCE cBackImage SIZE 130, 95 OF oFld1:aDialogs[ 2 ]
oImage3:nUserControl := 0 // disable actions
oImage3:lBmpTransparent := !(Lower( cFileExt( c_Path1 + cBackImage, ) ) $ "jpg,jpeg") // disable transparent in JPG
oImage3:bChange := { || oImage3:lBmpTransparent := ;
!(Lower( cFileExt( c_Path1 + cBackImage, ) ) $ "jpg,jpeg"), ;
oImage3:Refresh() }
//FREE_LINE(Object, hDC, nTop, nLeft, nBottom, nRight, nLineType, nColor, nPensize, nTransp )
oImage3:bPainted := < |hDC|
FREE_LINE(oImage3, hDC, 10, 10, 80, 120, 1, 255, 8, 255 )
FREE_LINE(oImage3, hDC, 10, 120, 80, 10, 1, 255, 8, 255 )
RETURN NIL
>
...
...
// -------------- normal or glowing lines
FUNCTION FREE_LINE(Object, hDC, nTop, nLeft, nBottom, nRight, nLineType, nColor, nPensize, nTransp )
LOCAL oGraphics, oPen, nRed, nGreen, nBlue
LOCAL n, nPen
oGraphics := Graphics():New( hDC )
nRed := nRGBRed( nColor )
nGreen := nRGBGreen( nColor )
nBlue := nRGBBlue( nColor )
IF nLineType = 1 // line
oPen := Pen():New( nTransp, nRed, nGreen, nBlue, nPensize )
oGraphics:DrawLine( oPen, nLeft, nTop, nRight, nBottom ) // oPen , nLeft, nTop, nRight, nBottom
ELSE // glow
nPen := nPensize * 0.5
nTransp := 255
oPen := Pen():New( nTransp, nRed, nGreen, nBlue, nPen )
FOR n = 1 to 6
oGraphics:DrawLine( oPen, nLeft, nTop, nRight, nBottom ) // oPen , nLeft, nTop, nRight, nBottom
nTop := nTop - nPen
nLeft := nLeft - nPen
nRight := nRight + 2 * nPen
nBottom := nBottom + 2 * nPen
nTransp := nTransp - 41
oPen:setcolor( nTransp, nRed, nGreen, nBlue ) // transparent change
NEXT
ENDIF
oPen:Destroy()
oGraphics:Destroy()
RETURN NIL
oImage:bPainted := < |hDC|
nHeight := oImage:nHeight - 20
nWidth := oImage:nWidth - 10
FREE_LINE(oImage, hDC, 10, 10, nHeight, nWidth, 2, 255, 4, 255 )
FREE_LINE(oImage, hDC, 10, nWidth, nHeight, 10, 2, 255, 4, 255 )
// FREE_LINE(oImage, hDC, 10, 10, 80, 120, 2, 255, 4, 255 )
// FREE_LINE(oImage, hDC, 10, 120, 80, 10, 2, 255, 4, 255 )
RETURN NIL
>
IF nLineType = 1 // line
oPen := Pen():New( nTransp, nRed, nGreen, nBlue, nPensize )
oGraphics:DrawLine( oPen, nLeft, nTop, nRight, nBottom ) // oPen , nLeft, nTop, nRight, nBottom
ELSE // glow
nPen := nPensize * 0.5
nTransp := 255
oPen := Pen():New( nTransp, nRed, nGreen, nBlue, nPen )
FOR n = 1 to 6
oGraphics:DrawLine( oPen, nLeft, nTop, nRight, nBottom ) // oPen , nLeft, nTop, nRight, nBottom
nTop := nTop + nPen
nBottom := nBottom + nPen
nTransp := nTransp - 41
oPen:setcolor( nTransp, nRed, nGreen, nBlue ) // transparent change
NEXT
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 105 guests