![]() If the version number is zero, the default patterns are used. ![]() If you change the contents of this section with care, you can set up your own patterns. The 512 bytes of header contain version information, pattern definitions, and an unused area for future expansion. ![]() The file is essentially a 512 byte header followed by a bit image that is 576 pixels wide by 720 pixels tall (or 72 bytes by 720 rows). MacPaint images are kept in the data fork of a MacPaint file. Well look at two of these later in the program. The Macintoshs ROM contains several QuickDraw calls that allow you to manipulate bitmaps (on- or off-screen). You can easily create a picture in a bit image off-screen, and later in your program stamp it onto the Macs screen. Since we can treat bit images in C as arrays of characters, we dont always have to display them immediately. The top left corner of the rectangle is aligned with the first bit of the bit image. The rectangle bounds provides the coordinate system for the bits. The rowBytes field contains the number of bytes per row in the bit image. The baseAddr field points to the first byte (character) in the bit image. A bit- map is a structure which points to a bit image and associates a coordinate system with it. For example, if we wanted to define the Macintosh screens bit image, the definition would be:īit images are manipulated by Quick- Draw through the use of bitmaps. In C, the easiest way to define a bit image is with an array of characters. Due to the 68000 microprocessor in the Macintosh, every bit image must have an even number of bytes per row, and the rows must begin and end on word boundaries. We can consider the screen bit image as being 342 rows with 64 bytes per row. The bit image in memory takes up 175,104 bits (or 21,888 bytes with 8 bits per byte). The Mac screen is 512 pixels wide by 342 pixels tall. If the bit is 0, then the pixel will be white. If the value of one of these bits is 1, then the pixel corresponding to it will be black. That is, what appears on the screen is actually a collection of consecutive bits in memory that the hardware in the Mac interprets as screen dots (or pixels). This article will explain that format and show you how to transfer your own images into MacPaint files. The MacPaint file format is rapidly becoming the standard for transferring graphic information from one application to another. MacPaint files Volume Number: 1 Issue Number: 7 Column Tag: C Workshop
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |