zpl.tools
Graphics Commands

^GB - Graphic Box

Draws boxes, lines, and rectangles

^GB - Graphic Box

Overview

The ^GB command draws rectangular boxes, lines, and other rectangular graphics on the label.

Syntax

^GBw,h,t,c,r

Parameters

  • w = Box width in dots
  • h = Box height in dots
  • t = Border thickness in dots
    • 0 = No border
    • 1-n = Line thickness
  • c = Line color
    • B = Black (default)
    • W = White
  • r = Corner rounding (dots, optional)
    • 0 = Square corners (default)
    • 1-n = Rounded corner radius

Description

  • Creates rectangular graphics
  • Draws lines and borders
  • Supports variable thickness
  • Can create rounded corners
  • Useful for visual formatting

Usage Notes

  • Place with ^FO before using
  • Width and height in dots
  • Thickness 0 creates outline only
  • Both filled and hollow boxes supported
  • Color affects appearance on label

Example

^XA ^FO50,50 ^GB400,200,10,B ^FS ^FO100,100 ^GB200,100,2,B ^FS ^XZ

Creating Different Shapes

WidthHeightTypeUsage
2002Horizontal lineSeparator
2200Vertical lineBorder
200100RectangleBox
200200SquareFrame

Thickness Guidelines

ThicknessUsage
0Outline only
1-2Thin line
3-5Medium line
5+Thick line

Rounded Corners

^GB200,100,2,B,10   # 10-dot radius corners
^GB200,100,2,B,0    # Sharp corners
  • ^GC - Graphic Circle
  • ^GE - Graphic Ellipse
  • ^GD - Graphic Diagonal Line
  • ^GF - Graphic Field

See Also