ZBR

Also Known As: Zebra Metafile


Type Metafile
Colors 24-bit
Compression None
Maximum Image Size 1 meter x 1 meter 2560 dpi
Multiple Images Per File No
Numerical Format Little-endian
Originator Zoner Software
Platform Microsoft Windows
Supporting Applications

Zoner Zebra for Windows, Zoner Archive, Zoner Present

See Also

Microsoft Windows Bitmap, Microsoft Windows Metafile

Usage
Storage and exchange of vector graphics including bitmaps and multi-layered sheets.

Comments
Usable in DTP applications.

Code fragments are available for this format.

Sample images are available for this format.


ZBR (Zebra Metafile) is the native metafile format of the Zebra for Windows vector graphics editor supported by Zoner Software. ZBR v1.0 supports these main types of raster and vector entities:

Polyline (combination of lines and Bezier curves)
Rectangle (including rounded and sharp corners, etc.)
Ellipse
Star
Polygon
Bitmap
Table
Paragraph text
Artistic text
WMF object

All of these entities, excluding bitmaps, can be defined using the following attributes:


 
Style of pen 
  type
  width
  line endings (arrow, circle, ...)
 
Style of fill
  solid color
  gradient (multicolor)
    linear
    radial
    conical
    square
    cross
  pattern fill (user defined)
  bitmap fill
 
Shadow
  offset
  color or change of brightness of object             

Contents:
File Organization
File Details
For Further Information

ZBR2.0, due out sometime in 1996, will support multi-page documents and will conform to Microsoft's Structured Storage specification and OLE 2.0. New entities will be added (such as arc and braced), and Microsoft Windows Metafile (WMF) objects will be supported as a main entity.

File Organization

ZBR files contain a header followed by a thumbnail bitmap of the primary graphics data, a variable-size section of configuration data, a color palette, and one or more object entities.

Header

Preview Bitmap

Configuration Data

Color Palette

Object 1

Object 2

Object n

File Details

The ZBR file header is 104 bytes in length and has the following format:

typedef struct _ZbrHeader
{
    WORD  FileId;           /* File ID value (always 029Ah) */
    WORD  FileVersion;      /* Version of the file */
    CHAR  Comment[100];     /* Text comment */
} ZBRHEADER;

FileId is the file identification value and is always 029Ah.

FileVersion is the version of the ZBR format to which the file conforms. This value is 1 for v1.x, 2 for v1.1x and 1.2x, 3 for v1.49, and 4 for v1.50.

Comment is a NULL-terminated text comment string 100 bytes in length.

Following Comment is a preview image of the file's primary graphics data. This preview is always 5264 bytes in size:

typedef struct _ZbrPreview
{
    BYTE PreviewDibPalette[64]; /* Preview bitmap color palette */
    BYTE PreviewDib[5200];      /* Preview bitmap of primary image */
} ZBRPREVIEW;

PreviewDibPalette is a 64-byte, Windows color palette containing 16 RGBQUAD entries. See the information on Windows color palettes below.

PreviewDib is a 5200-byte, 16-color Microsoft Windows Device Independent Bitmap (DIB) 100x100 pixels in size. Each pixel is four bits in depth, packed two pixels per byte, and padded to the nearest byte boundary. The pixels contain index values pointing into the color palette stored in the PreviewDibPalette field.

Following PreviewDib is a variable-size block of configuration data used by Zoner software applications. The format of the data in this configuration block is not currently published, but we can assume that it is at least four bytes in size:

typedef struct _ZbrConfiguration
{
    DWORD ConfigLength;  /* Size of the local configuration data in bytes */
    BYTE  *LocalConfig;  /* Local configuration data (variable size) */
} ZBRCONFIGURATION;

ConfigLength is the length of the LocalConfig field in bytes.

LocalConfig is the actual configuration data.

Following LocalConfig is the color palette information for the primary graphics data. We can also assume that this structure is at least four bytes in length:

 
typedef struct _ZbrPalette
{
    DWORD PaletteLength;    /* Length of color palette in bytes */
    BYTE  *Palette;         /* Color palette (variable size) */
} ZBRPALETTE;

PaletteLength is the total length of the palette in bytes. Each palette entry is four bytes in size, so a 256-color palette would be 1024 bytes in length.

Palette is an array of Microsoft RGBQUAD palette entry structures. Each palette entry is four bytes in size and has the following structure:

 
typedef struct _RgbQuad
{
    BYTE Blue;      /* Blue component */
    BYTE Green;     /* Green component */
    BYTE Red;       /* Red component */
    BYTE Reserved;  /* Padding (always 0) */
} RGBQUAD;

Blue, Green, and Red hold the color component values for a pixel each in the range 0 to 255.

Reserved is used to pad the structure to end on an even-byte boundary and is always zero.

The number of palette entries may be calculated as such:

NumOfEntries = PaletteLength / sizeof(RGBQUAD);

Given the structure of these four sections, we can construct the following structure of a ZBR file:

typedef struct _ZbrFile
{
    ZBRHEADER        Header;
    ZBRPREVIEW       Preview;
    ZBRCONFIGURATION Configuration;
    ZBRPALETTE       Palette;
    VOID             *Objects;
} ZBRFILE;

Image Data

The structure and layout of the object entities in the ZBR format is not published. It is, however, possible to read the header and to display the preview bitmap. Example code for a Windows application that displays the preview bitmap from a ZBR file may be found on the CD-ROM.

For Further Information

For further information about the ZBR format, please contact:

Zoner Software Ltd.
Development Department.
Kozeluzska 7
Brno CZ-602 00
Czech Republic
Voice: +42-5-45214788
FAX: +42-5-45214788
Email: zoner@zoner.anet.cz



Copyright © 1996, 1994 O'Reilly & Associates, Inc. All Rights Reserved.