Visitor # 4922 since 14.SEP.2003


Autodesk Slide File Format


Introduction:

AutoCAD slide files are screen images written by the MSLIDE command and read by the VSLIDE command. This section describes the format of slide files, for the benefit of developers who wish to incorporate support for AutoCAD slides into their programs. This information is for experienced programmers, and is subject to change without notice.


New Slide File Header:

The general format of a slide file is:

  1. Header (31 bytes)
  2. One or more data records (variable length)

All coordinates and sizes written to the slide file reflect the graphics area of the display device from which the slide was created, with point (0,0) located at the lower left corner of the graphics area. For AutoCAD Release 9 and later, the slide file header consists of the following fields:

Field Length (bytes) Description
Id string 17 "AutoCAD Slide" CR LF ^Z NUL
Type indicator 1 Currently set to 86 (decimal).
Level indicator 1 Currently set to 2.
High X dot 2 Width of the graphics area - 1, in pixels.
High Y dot 2 Height of the graphics area - 1, in pixels.
Aspect ratio 4 Aspect ratio (horizontal size / vertical size) of the graphics area, scaled by 10,000,000. This value is always written with the LSB first.
Hardware fill 2 Either 0 or 2 (value is unimportant).
Test number 2 A number (1234 hex) used to determine whether all 2-byte values in this slide file were written with the high byte first (as by Intel x86-family CPUs) or the low byte first (as by MIPS R4K-family CPUs).

New Slide File Header


Slide File Data Records:

Data records follow the header. Each data record begins with a 2-byte field whose high-order byte is the record type. The remainder of the record may be composed of 1-byte or 2-byte fields, as described in the following table. To determine whether the 2-byte fields are written with the high byte first or the low byte first, examine the Test number field of the header, described above.

Record type (hex)

Length (bytes)

Meaning

Description

00 - 7F

8

Vector

The from-X coordinate for an ordinary vector. From-Y, to-X, and to-Y follow in that order, as 2-byte values. The from point is saved as the last point.

80 - FA

n/a

Undefined

Reserved for future use.

FB

5

Offset vector

The LSB and the following three bytes specify the endpoints (from-X, from-Y, to-X, to-Y) of a vector, in terms of offsets (-128 to +127) from the saved last point. The adjusted from point is saved as the last point for use by subsequent vectors.

FC

2

End of file

The LSB is 00.

FD

6

Solid Fill

The LSB is 00. The following two 2-byte values specify the X and Y coordinates of one vertex of a polygon to be solid-filled. 3 to 10 such records occur in sequence. A Solid fill record with a negative Y coordinate indicates the start or end of such a flood sequence. In the start record, the X coordinate indicates the number of vertex records to follow.

FE

3

Common endpoint vector

This is a vector starting at the last point. The low-order byte and the following byte specify to-X and to-Y in terms of offsets (-128 to +127) from the saved last point. The adjusted to point is saved as the last point for use by subsequent vectors.

FF

2

New color

Subsequent entities are to be drawn using the color number (ACI) indicated by the LSB.

Slide File Data Record Types


Example Slide File:

If a slide contains any vectors at all, a New color record will be the first data record. The order of the vectors in a slide, and the order of the endpoints of those vectors, may vary. For example, the following is an annotated hex dump of a simple slide file created on an IBM PC/AT with an IBM Enhanced Graphics Adapter. The slide consists of a white diagonal line from the lower left corner to the upper right corner of the graphics area, a green vertical line near the lower left corner, and a small red rectangle at the lower left corner.

Data Stream (bytes - in hex) Description
41 75 74 6F 43 41 44 20 53 6C 69 64 65 0D 0A 1A 00 Id string ("AutoCAD Slide" CR LF ^Z NUL)
56 Type indicator (86)
02 Level indicator (2)
3C 02 High X dot (572)
24 01 High Y dot (292)
0B 80 DF 00 Aspect ratio (14,647,307 / 10,000,000 = 1.46)
02 00 Hardware fill (2)
34 12 Test number (1234 hex)
07 FF New color (7 = white)
3C 02 24 01 00 00 00 00 Vector from 572,292 to 0,0. 572,292 becomes "last" point
03 FF New color (3 = green)
0F 00 32 00 0F 00 13 00 Vector from 15,50 to 15,19. 15,50 becomes "last" point
01 FF New color (1 = red)
12 FB E7 12 CE Offset vector from 15+18,50-25 (33,25) to 15+18,50-50 (33,0). 33,25 becomes "last" point
DF FE 00 Common-endpoint vector from 33,25 to 33-33,25+0 (0,25). 0,25 becomes "last" point
00 FE E7 Common-endpoint vector from (0,25) to 0+0,25-25 (0,0). 0,0 becomes "last" point
21 FE 00 Common-endpoint vector from (0,0) to 0+33,0+0 (33,0). 33,0 becomes "last" point
00 FC End of file
Example Slide File

Old Slide Header:

The slide format described above is that produced by AutoCAD Release 9 and later, and is portable among all computers running AutoCAD Release 9 or later. Previous versions of AutoCAD (as well as AutoShade 1.0 and AutoSketch 1.02) produce slides with a somewhat different header, as shown below.

Field

Length (bytes)

Description

Id string

17

"AutoCAD Slide" CR LF ^Z NUL

Type indicator

1

Currently set to 86 (decimal).

Level indicator

1

1 (old format).

High X dot

2

Width of the graphics area - 1, in pixels.

High Y dot

2

Height of the graphics area - 1, in pixels.

Aspect ratio

8

Aspect ratio (horizontal size / vertical size) of the graphics area,, written as a double-precision floating point number (IEEE-format, MSB first).

Hardware fill

2

Either 0 or 2 (value is unimportant).

Filler byte

1

Unused

Old Slide File Header


Back to the AutoCAD Bonus Pack


Send email to me. ===>> picture of the Author

[Last updated: 25.December.2014]