xbrowse bchange -> display box

xbrowse bchange -> display box

Postby Silvio.Falconi » Wed Mar 16, 2022 1: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

Image

example
Image

any test sample pls ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse bchange -> display box

Postby Marc Venken » Wed Mar 16, 2022 9: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: Select all  Expand view

#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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1357
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: xbrowse bchange -> display box

Postby Silvio.Falconi » 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse bchange -> display box

Postby Marc Venken » 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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1357
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: xbrowse bchange -> display box

Postby Silvio.Falconi » Thu Mar 17, 2022 2: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse bchange -> display box

Postby Detlef » Thu Mar 17, 2022 10:42 pm

try to show an animated gif which is blinking at the desired position.
User avatar
Detlef
 
Posts: 205
Joined: Mon Feb 07, 2022 9:54 pm

Re: xbrowse bchange -> display box

Postby Silvio.Falconi » Fri Mar 18, 2022 8: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.

Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse bchange -> display box

Postby Detlef » 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
User avatar
Detlef
 
Posts: 205
Joined: Mon Feb 07, 2022 9:54 pm

Re: xbrowse bchange -> display box

Postby Silvio.Falconi » Fri Mar 18, 2022 1: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: xbrowse bchange -> display box

Postby Detlef » Fri Mar 18, 2022 6:45 pm

Sorry, Silvio,
I made an error answering the wrong topic.
See you there...
User avatar
Detlef
 
Posts: 205
Joined: Mon Feb 07, 2022 9:54 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 34 guests