How to display a red colored square over an image at x,y coordinates ( measure on mm) and the square should blink
Can have a small sample please ?
I create this

Problems
1) the square is not flashing
2) if I change record it does not delete the previous one
Any help please
the test
Can have a small sample please ?
I create this

Problems
1) the square is not flashing
2) if I change record it does not delete the previous one
Any help please
the test
oBrw:bChange := { || ShowBox(oBrw,oCoupon) }
FUNCTION ShowBox(oBrw, oImage)
LOCAL hDC, nX, nY, nSize, hBrush
LOCAL nImgX, nImgY
// Coordinate del quadrato in mm (distanze specificate)
nX := VAL(oBrw:aArrayData[oBrw:nArrayAt][2])
nY := VAL(oBrw:aArrayData[oBrw:nArrayAt][3])
nSize := 2 // dimensione del quadrato
// Dimensioni e posizione dell'immagine
nImgX := 10 // Posizione X dell'immagine
nImgY := 0 // Posizione Y dell'immagine
// Converti le misure da mm a pixel (96 DPI)
nX := nX * 96 / 25.4
nY := nY * 96 / 25.4
nSize := nSize * 96 / 25.4
nImgX := nImgX * 96 / 25.4
nImgY := nImgY * 96 / 25.4
// Calcola le coordinate finali tenendo conto della posizione dell'immagine
nX := nImgX + nX
nY := nImgY + nY
hDC := oImage:GetDC()
// Cancella il quadrato precedente disegnando uno sfondo bianco
hBrush := CreateSolidBrush(RGB(255, 255, 255)) // Bianco
SelectObject(hDC, hBrush)
Rectangle(hDC, nX, nY, nX + nSize, nY + nSize)
// Disegna il nuovo quadrato lampeggiante
IF MOD(GetTickCount(), 1000) < 500
hBrush := CreateSolidBrush(RGB(255, 0, 0)) // Rosso
ELSE
hBrush := CreateSolidBrush(RGB(255, 255, 255)) // Trasparente (o sfondo)
ENDIF
SelectObject(hDC, hBrush)
Rectangle(hDC, nX, nY, nX + nSize, nY + nSize)
// Rilascia il contesto e pulisci
oImage:ReleaseDC(hDC)
DeleteObject(hBrush)
RETURN nilSince from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

