Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drawing a filled rectangle 2

Status
Not open for further replies.

Jay1b

Programmer
Apr 27, 2004
15
GB
Hi

I am relatively new to PCL and was wondering whether somebody could help me put the pieces together so to speak.

I am trying to draw a filled rectangle/square 1.5cm (1/2 inch) in size in a certain location on the report.

I have tried reading the manuals, but seem to explain how to do 1 bit, but not another - ie: how to fill the rectangle but not how to draw it in the first place.

Could somebody please give me an example, of a filled shape placed in a particular place on a page - explaining what each section does?

Thanks
Jay.
 
You didn't say what kind of a fill, but let's assume
a 15% halftone...

<esc>*c15G<esc>*c150a150b2P



Jim Asman
jlasman@telus.net
 
And for an analysis of Jim's sequence ("explaining what each section does"):
[tt]
<Esc>*c15G Assign Pattern ID
<Esc>*c150a Rectangle Size (PCL units): Horizontal
150b Rectangle Size (PCL units): Vertical
2P Fill Rectangular Area: Shading
[/tt]
Note that the above does not include any sequences to position the cursor (and hence the filled rectangle).
 
Thanks guys.

We use a number of reports at work, and every couple of months one of them needs slightly changing. So i know the principle behind it, but i dont ever really do enough to learn the language itself, without delving into the manuals everytime, which to be honest give me nightmares. When i tried this out of the manual i found something else, which worked, on the first label, but when it tried to write the 2nd, 3rd, etc labels it just overwrote the first black box - and relative positioning didnt seem to work either. Here's what it was:

.print '^[%0B;' (q0) /* Enter HP-GL/2 mode */
.print 'IN;' (q0) /* Initialize HP-GL/2 mode */
.print 'SP1;' (q0) /* Must be used to enable printing */
.print 'SC0,150,0,150,1;'(q0) /* Setup User Scaling */
.print 'PA38,152;' (q0)/* Specify absolute plotting mode & move */
.print 'EA62,166;' (q0) /* Use EA to outline the shape*/
.print 'FP' (q0) /* Fill rectangle */
.print '^[%0A'

What you suggested not only, works but it fits in perfectly with our current way of doing things. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top