Delete Lines from a graphics

Post Reply
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Delete Lines from a graphics

Post by Silvio.Falconi »

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

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
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Delete Lines from a graphics

Post by Natter »

When working with DC, it is convenient to use FWSaveScreen() and FWRestScreen()
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: Delete Lines from a graphics

Post by Silvio.Falconi »

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
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Delete Lines from a graphics

Post by Natter »

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()
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: Delete Lines from a graphics

Post by Silvio.Falconi »

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
Post Reply