home *** CD-ROM | disk | FTP | other *** search
- IconEdit V1.0
-
- by William C. Thompson (wct@po.cwru.edu) - 11/91
-
- This icon editor was help make your programs look more
- professional by adding an extra artistic element that was before
- missing because of the ominous task of drawing the pictures. This
- program makes it all very easy. You use the editor to create your
- icons (variable size), save it to disk, and load it into your
- program using the sample program provided below. You can work on
- several icons simultaneously. Drawing is made easy with intuitive
- commands and clicking. Now that I've put in my plug, let's get
- started.
-
- The first thing anyone wants to do with sort of thing is play
- before they start anything real, so I am going to walk through the
- program step by step.
-
- You can select the foreground color by left-clicking in the
- color bar. The foreground color bar change as you select. The
- background color can be selected by right-clicking. Now that
- you're armed with your colors, you're ready to draw. Left and
- right clicking will color in the blocks of the icon. Each block
- represents one pixel. Notice that the picture is also being drawn
- in the first box of the lower-right hand corner. This is how the
- icon will actually appear on screen. When you're ready to erase
- what you've done and start over, select Clear in the menu to fill
- the icon with background color.
-
- Now that you've had a chance to give it a quick test, you
- would like to be able to set the size. Select Set Size in the
- menu. The mouse will disappear, and you will be prompted for the
- size of the new icon. There must be at least two rows (up and
- down) and columns (side to side), but no more than fifty of either.
- Illegal entries will be ignored. Pressing ESC will abort the
- selection.
-
- The icon can be easily transformed. Flip Horizontal will flip
- the icon about the horizontal axis. Flip Vertical will flip it
- about the center line. Rotate Left will rotate the icon once
- counter-clockwise, and Rotate Right will rotate the icon clockwise.
-
- Often you would like to change or erase all of the blocks of
- a particular color. Select this color as the foreground color.
- Then select Change Color. You will then be prompted for the color
- to change it to, or you can select Cancel.
-
- Selecting Grid Color will change the color of the grid to the
- foreground color. This is useful if you are drawing in the current
- grid color (light gray) or would like to hide the grid.
-
- You should now be familiar with all of the basic tools of
- drawing. Once you have created a masterpiece, you would like to
- save it. Select Save in the menu. The mouse will disappear and
- you will be prompted for the file to save it to. The file will be
- saved in the current directory with an .ICN extension. A sample
- program to read the image into a Pascal program is listed near the
- end of this document.
-
- The nine boxes (slots) in the lower-right hand corner store
- icons that may be worked on at once. Simply select one of the
- boxes to make that your working slot. The current slot is
- indicated by a yellow rectangle surrounding the slot. The Copy
- option allows you to copy the icon to another slot.
-
- Select Load to load an icon from disk. If nothing happens,
- either the file does not exist in the current directory, or it was
- unable to be accessed. The icon will be loaded into the current
- slot, wiping out everything there, so make sure you select a slot
- with nothing important in it.
-
- Transformations can also be performed on sections of an icon.
- Position the mouse to where you want to start selecting a section.
- Click both buttons at once to mark the first corner. You will be
- prompted to select the second corner. You can escape the entire
- process at any time be selecting Cancel. Position the mouse and
- double-click again to set the second corner. A box will formed
- around the selected section. Clear will fill the section with the
- background color. You can also flip it horizontally and vertical.
- If the section is square, it can be rotated left and right as well.
- You can move or copy the section to another place in the icon.
- These require a somewhat more lengthy explanation.
-
- For each selection, you will be prompted to provide the upper-
- left hand corner of the destination. The destination must allow
- enough space for the size of the selection. When you move a
- section, it fills where the section used to be with the background
- color. For moving or copying, squares in section with the
- background color are ignored. This means that any block that is
- the background color will not overwrite any block in the
- destination.
-
- This should be all you will need to create your icons, now you
- need to read them into a program.
-
- program readicon;
- uses
- graph;
- var
- gd,gm: integer;
- f: file;
- image: pointer;
- size: word;
- begin
- gd:=detect;
- initgraph(gd,gm,<graphics path>);
- assign(f,<icon file>);
- reset(f,1);
- size:=filesize(f); { gets size of image }
- getmem(image,size); { allocates memory }
- blockread(f,image^,size); { reads Size bytes from file }
- close(f);
- putimage(<x-coor>,<y-coor>,image^,copyput);
- readln;
- closegraph;
- end.
-
-
- All source code (well-documented) is available for $20. I
- would even be willing to make slight modifications for a humble
- fee. Send all inquiries and requests to:
-
- William C. Thompson
- 11896 Carlton Rd. Box 620
- Cleveland, OH 44106
-
- I can be reached via E-mail at wct@po.cwru.edu. If you prefer more
- primitive means of communication, I can be reached by phone at
- (216) 754-2080, but be prepared to leave a message. :)