FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xbrowse bchange -> display box
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
xbrowse bchange -> display box
Posted: Wed Mar 16, 2022 01:01 PM
changing records from an xbrowse I want to display an intermittent black square on a jpg image to display the printing coordinates for a coupon



example


any test sample pls ?
Since 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
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: xbrowse bchange -> display box
Posted: Wed Mar 16, 2022 09:15 PM
Silvio,

Maybe this code can be a starting point.

Take your picture from lotto and save it as test.jpg and run this sample.
This sample is from a post here : :

viewtopic.php?f=3&t=28271&hilit=merge+jpg

Code (fw): Select all Collapse
#include "Fivewin.ch"


#define SRCCOPY 13369376


FUNCTION MAIN()

    LOCAL oDlg, oImg

    DEFINE DIALOG oDlg;
           SIZE 800, 600

    @ 0, 0 IMAGE oImg;
           SIZE 150, 100;
           FILE "TEST.JPG";
           ADJUST

    @ 15, 0 BUTTON "Draw";
            ACTION DRAWIMG( oImg )

    @ 15, 20 BUTTON "Save";
             ACTION oImg:SaveImage( "MYIMAGETEST.JPG", 2 )

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


STATIC FUNCTION DRAWIMG( oImg )

    LOCAL hDC := oImg:GetDC()

    LOCAL nWidth  := oImg:nWidth()
    LOCAL nHeight := oImg:nHeight()

    LOCAL hMemDC := CREATECOMPATIBLEDC( hDC )

    LOCAL hMemBmp := CREATECOMPATIBLEBITMAP( hDC, nWidth, nHeight )

    LOCAL hBmpOld := SELECTOBJECT( hMemDC, hMemBmp )

    LOCAL hBitmap  := oImg:hBitmap
    LOCAL hPalette := oImg:hPalette

    LOCAL x, y

    PALBMPDRAW( hMemDC, 0, 0, hBitmap, hPalette, nWidth, nHeight )

    FOR y = 128 TO 135
        FOR x = 128 TO 135
            SETPIXEL( hMemDC, x, y, CLR_HRED )
        NEXT
    NEXT

    FOR y = 110 TO 117
        FOR x = 110 TO 117
            SETPIXEL( hMemDC, x, y, CLR_HRED )
        NEXT
    NEXT


    SELECTOBJECT( hMemDC, hBmpOld )

    DELETEDC( hMemDC )

    oImg:hBitmap = hMemBmp

    PALBMPFREE( hBitmap, hPalette )

    PALBMPNEW( oImg:hWnd, oImg:hBitmap, oImg:hPalette )

    oImg:Refresh()

    RETURN NIL
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xbrowse bchange -> display box
Posted: Thu Mar 17, 2022 10:14 AM

Something like that although I'd like to have the squares blinking.
A question: if a pixel is at x, y on the video how does it relate to the print?
I'll explain well: the user must select some numbers that he must play and the press must insert black boxes in correspondence with the numbers themselves

Since 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
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: xbrowse bchange -> display box
Posted: Thu Mar 17, 2022 11:04 AM

I try to understand what you would like to do...

I would generate a dialog with all buttons (bmp) for each lotto nummer. (design the lotto form) At that point, you have a button for each number that can interact with clicks and change the button into a square and/or other color etc... Printing will be something like a lottoform jpg to print and position the squares on it. As always... easier said than done )))

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xbrowse bchange -> display box
Posted: Thu Mar 17, 2022 02:00 PM
Marc Venken wrote:I try to understand what you would like to do...

I would generate a dialog with all buttons (bmp) for each lotto nummer. (design the lotto form) At that point, you have a button for each number that can interact with clicks and change the button into a square and/or other color etc... Printing will be something like a lottoform jpg to print and position the squares on it. As always... easier said than done )))

l
there are many points to draw not only 90 numbers

i have tried with some coordinates and it works great I just don't understand how to have the blink as if it were a cursor
Since 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
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Re: xbrowse bchange -> display box
Posted: Thu Mar 17, 2022 10:42 PM

try to show an animated gif which is blinking at the desired position.

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xbrowse bchange -> display box
Posted: Fri Mar 18, 2022 08:37 AM
Detlef wrote:try to show an animated gif which is blinking at the desired position.




Detlef,
that is an example, I have to insert a black pixel in all squares of the module
if it was blinking it was better because it displayed to the user where the pixel was located
I have problems with BITMAP AND IMAGE because the image is not clear,
If I use a Png file with XIMAGE AND BITMAP I have to use freeImage.dll and in any case the image is not clear, because I have to insert it all in a dialog, the user must enter the coordinates where the pixels are placed, if I use adjust the image is not clear
If I use ximage the image is clear but then the Draw function of the example above is not compatible and makes an error and I did not understand how I can modify it.

Since 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
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Re: xbrowse bchange -> display box
Posted: Fri Mar 18, 2022 12:35 PM

Silvio,
I understand your problem.
Unfortunately I'm on voyage at the moment.
I'll send you a formula for finding the correct place of each number later today.
Pleased, tell me the perimeter of one of the circles.
Regards, Detlef

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xbrowse bchange -> display box
Posted: Fri Mar 18, 2022 01:46 PM
Detlef wrote:Silvio,
I understand your problem.
Unfortunately I'm on voyage at the moment.
I'll send you a formula for finding the correct place of each number later today.
Pleased, tell me the perimeter of one of the circles.
Regards, Detlef


Pls see another topic I wrote on forum I explained all akso measures, I have problem also to print it
Since 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
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Re: xbrowse bchange -> display box
Posted: Fri Mar 18, 2022 06:45 PM

Sorry, Silvio,
I made an error answering the wrong topic.
See you there...

Continue the discussion