Page 1 of 1

Print Colored Box

Posted: Fri May 22, 2020 5:18 pm
by Silvio.Falconi
I tried to recreate the beach plan with the Printer class, with the cmBox function

it is possible to color inside the boxes which function can I use?

Image

Re: Print Colored Box

Posted: Fri May 22, 2020 9:57 pm
by nageswaragunupudi
Use method Box()

Syntax

Code: Select all

METHOD Box( nTop, nLeft, nBottom, nRight, ;
       [Pen], ;   // oPen/hPen/nColor/{nColor,nThickness}
       [Brush], ; // nColor / oBrush
       [aText], ; // { cText, oFont, nColor } Painted in center
       cUnits ;   // "CM", "MM", "INCHES"
       )
 
You specify the color in the 6th param.
Params 5,6,7 are optional.

Re: Print Colored Box

Posted: Sat May 23, 2020 9:13 am
by Silvio.Falconi
thanks Rao.
I have to make a print of the beach in order to view the numbers, the status of each item. This type of printing is called the Lifeguard Sheet, because the lifeguard usually uses the paper and assigns the rentals on the paper.
My problem is that the beach scheme is created in 20 rows by 40 columns and a maximum of 800 positions (boxes) can be inserted even if generally in the plan of the beach there are in addition to the rentable elements also the accompanying elements (plants, walkways , chalet) which are not to be printed in the lifeguard printout.
As you can see in the print here, the small square on the right is the last position of the beach plan, that is 1-40, I tried to narrow the boxes to get everything into one A4 sheet but it is very difficult

Image

it never happens that a chalet has all these umbrellas in width but a chalet could happen. in fact at an old bathing establishment there were 2500 umbrellas


Example on road

the one circled in red is a single bathhouse with over 60 columns for 9 rows of umbrellas

Image

Re: Print Colored Box

Posted: Sat May 23, 2020 9:40 am
by Silvio.Falconi
Now I tried with box with brush
as you can clearly see the measurements of the oprn: Box () function are not the same as the oPrn: cmBox () function
Any solution ?

Image

Re: Print Colored Box

Posted: Sat May 23, 2020 10:24 am
by nageswaragunupudi
Measurements of Box method should be correct.
cmBox is an old method and is now superseded by the enhancements made to Box method.

Re: Print Colored Box

Posted: Sat May 23, 2020 3:34 pm
by Silvio.Falconi
Rao , Resolved !!!

I managed to get in a 40x20 grid
the last box you see on the right corner is in position x40-y1
It is a great satisfaction I can put 800 elements on an A4 sheet

Image

I just can't lift the "Beach" logo
I made before of EndPage

@ nRow-5, 2000 PRINT TO oPrn IMAGE "LOGOBEACH" ;
SIZE 500,450;
PIXEL ALPHALEVEL 90

ENDPAGE

How print Hollow text there is a sample ?