Delete Lines from a graphics

Delete Lines from a graphics

Postby Silvio.Falconi » Tue Sep 24, 2024 6:59 am

Do you remember my TCyclometric class ?

I use a cyclometric calculation to predict the numbers that will come out in the next Italian lottery draws, obviously it is a technique already used by many people.

Image


for a sample you can see on figure the numbers of florence 66,77,4,29,37
the prevision numbers are 28,37,42,33



When I click on xbrowse at right on a row it draw the geometric figure into circle
if i click on another row made the same but

it does not delete previously created lines, how can I make the procedure delete previously created lines?


for a sample to calc the distance numbers I use this method


Code: Select all  Expand view
METHOD Distance(num1,num2)  CLASS  TCyclometric
   local  aNumpos := ::apos
   local nAt1,nAt2
   local oPen,hOldPen
   local aRect:= {}
   local nDistanza,nYOffset,nXOffset, nY,nX

  // xbrowser aNumpos

   nAt1:= AScan( aNumpos, { | a | a[1] = num1 } )
   nAt2:= AScan( aNumpos, { | a | a[1] = num2 } )

   aRect:= {aNumpos[nAt1][2],aNumpos[nAt1][3],aNumpos[nAt2][2],aNumpos[nAt2][3]}

   ::line( aRect[1],aRect[2],aRect[3],aRect[4], CLR_RED)


   // draw the distance number
         IF num2>num1
             nDistanza:= num2-num1
          else
             nDistanza:= num1-num2
          Endif
          If nDistanza > 45
            nDistanza:= 90-nDistanza
         Endif

       nYOffset = ::oFont:nHeight / 2
       nXOffset = ::oFont:nWidth / 2

       nY  := aRect[2]
       nX  := aRect[4]

  ::Say( nY - nYOffset, nX - nXOffset, LTRIM( STRzero( nDistanza,2 ) ), , , ::oFont, .t.,;
            .t., nil )

   return nil


it create lines and say the numbers , so how I can delete these lines and numbers ?
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Delete Lines from a graphics

Postby Natter » Tue Sep 24, 2024 7:52 am

When working with DC, it is convenient to use FWSaveScreen() and FWRestScreen()
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: Delete Lines from a graphics

Postby Silvio.Falconi » Tue Sep 24, 2024 8:23 am

Natter wrote:When working with DC, it is convenient to use FWSaveScreen() and FWRestScreen()


can you kindly try to help me if you can erase the lines?
Last edited by Silvio.Falconi on Wed Sep 25, 2024 6:43 am, edited 1 time in total.
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Delete Lines from a graphics

Postby Natter » Tue Sep 24, 2024 8:33 am

Sorry, there's no time. It's simple:
1. first save a fragment of the screen to the variable FWSavescreen()
2. Draw what you need
3. Restore fragment FWRestScreen()
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: Delete Lines from a graphics

Postby Silvio.Falconi » Tue Sep 24, 2024 10:41 am

Now I have the refill run ok

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: 7061
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 75 guests