Category : Miscellaneous Language Source Code
Archive   : 2BGI.ZIP
Filename : PCX2BGI.DOC

 
Output of file : PCX2BGI.DOC contained in archive : 2BGI.ZIP


HOW TO USE PCX2BGI.EXE
By Marty Balash, Waterbury CT
PCLINK: MarBal
03/03/91

FOR TURBO C AND TURBO PASCAL

A GRAPHICS UTILITY FOR DISPLAYING .PCX and .LBM FORMAT FILES
CONVERTS ALL OR PART OF PICTURE TO BGI IMAGE FORMAT

* Directly reads Deluxe Paint and PC Paintbrush pictures and saves them
as .MJB files (which are BGI images with a 28-byte header attached.)
A utility is provided to remove the header, if desired.
* Graphics created with paint programs can be easily displayed
by Turbo C and Turbo Pascal programs.
* A program using bitmapped graphics is as easy as opening a graphics
screen, reading a file, and using PutImage.
* Great for games, animations or any application.
* Turbo C programmers can hard-code smaller graphics into their programs
without needing external graphics files. C-code generation utility and
sample program provided.
* Shareware - Only $15.00!
Send To:
Marty Balash
2 Pinecrest Drive
Prospect CT 06712

***************************************************************************
* IMPORTANT - READ THIS: *
* Use this software at your own risk. I assume no responsibility for *
* any type of losses or difficulties of any kind that you encounter, *
* directly or indirectly, as a result of using these programs. They *
* have been tested only by me on my computer with compilers configured *
* to my preferences. *
* These programs (except for the Pascal) were written for my personal *
* use, and I decided to release them as shareware. *
* Please send me $15.00 if you find them useful. *
* - Deluxe Paint is a registered trademark of Electronic Arts, Inc. *
* - PC Paintbrush is a registered trademark of Z-Soft, Inc. *
* - Turbo C, Turbo Pascal and BGI are registered trademarks of Borland *
* International, Inc. *
***************************************************************************

TUTORIAL - Saving Part Of A Picture To Disk
o - Start the program with the supplied demo picture:
PCX2BGI MOUTHS.PCX
o - Wait for the picture to load, press any key when message comes up.
o - Press to select "Partial Screen" save.
o - MOUTHS.PCX will be displayed on the screen with a white "corner-
shaped" cursor in the upper left area of the screen.
- Try pressing the "C" key to change the color of the cursor and
status line (on the bottom of the screen).
- Press the "X" key to view the help screen.
Press any key except "C" to return to framing your image.
- Press the space bar to change the cursor speed and notice
that "Speed:" on the status line shows the current speed.
Use the cursor keys to move the cursor to the upper-left region
of the area you want to save. Press after you have selected
the upper-left corner.
o - The cursor has changed to a rectangle. Move the lower-right corner of
the rectangle to the lower-right region of the area you want to save.
Use the spacebar to change the cursor speed. Press when you
have framed the image you want to save.
o - When prompted for a filename, type:
MYTEST1
This will create a file called MYTEST.MJB.
Note: You could have left the filename blank if you didn't want to
save.
Note: Existing files won't be written over until you verify that you
want to do so.
o - When prompted "Select Another Image From Same Screen? (Y/N)", press
"N" to quit the program. You could continue working with the same
picture by entering "Y" at this prompt.
o - View the image you just saved:
SHOWMJB MYTEST1.MJB
SHOWMJB.C is in the zipped file for Turbo C programmers. The zipped
for Turbo Pascal programmers contains two TP demos.

TUTORIAL - Saving A Whole Picture To Disk
o - Start the program with the supplied demo picture:
PCX2BGI MOUTHS.PCX
o - Wait for the picture to load, press any key when message comes up.
o - Press the spacebar to move the arrow to "Full Screen".
o - Press to select "Full Screen" save.
o - MOUTHS.PCX will be displayed on the screen until you press a key.
o - When prompted for a filename, type:
MYTEST2
o - When prompted "Select A Partial Image From This Screen? (Y/N)", press
"N" to quit the program.
o - View the image you just saved:
SHOWMJB MYTEST2.MJB

NOTE ON USING PCX2BGI "PARTIAL SCREEN":
o - When framing a partial image from a screen, the bottom-most part
of the screen is not available, because of the status line.
A full-screen save will always save this part of the screen.
Don't draw any graphics down there if you plan on using a
partial save to get them.
o - The 11th color of the picture palette is being used for the cursor
and status line. The "C" key changes the color, but the not the
palette position of the cursor and status line (it's always the 11th
color in the palette). The image being displayed and the image
being saved use the original 11th color after exiting this
screen.
o - Use the coordinates on the status line when working. By making
a note of where the image was when you picked it up, you can
place it in exactly the same place from your program - just use
the (status line) X and Y coordinates in PutImage.
If you need to save similar images and want them all to be the
same size, note the coordinates before you press the
second time.
o - If you make a mistake framing your image:
Keep pressing until you return to picture screen
again, with the cursor in the upper left corner. The cursor
will be the same color as last time.
Pressing at the filename prompt will not save the image
you just framed, and pressing at the "Another Image?"
prompt will assume you mean "Y".

NOTE ON LOADING .LBM PICTURES:
They load slow. It doesn't affect the saved .MJB image.

WHAT FILES TO USE:
o - Turbo C programmers should unzip the file TC.ZIP first.
o - Turbo Pascal programmers should unzip the file TP.ZIP first.
o - Programmers should look through both zip files, TC.ZIP and TP.ZIP,
no matter what language they normally use.
- C programmers might want to look at TPDEMO2.PAS for a rough
demo of animation.
- Pascal programmers might want to look at SHOWMJB.C or CYCLE.C
(at least the comments) to see how to load a full screen image,
since I haven't included any Pascal code to do that.

Programming Tips:
* A quick way to clear an area of the screen is to
draw a solid rectangle, the same color as the
background, over the area.
* If an object is too big to save in one "Partial
Save", save it in two adjacent images. When
it's positioned on the screen, you can't tell that
the object is made up of two images.
* Use the program TPCONV.EXE in the TP.ZIP file to
create header files containing palettes from
various pictures. These 28-byte header files can be
loaded for the purpose of alternating color palettes
while displaying images.
* If you don't like the 28-byte header on the
.MJB files, TPCONV.EXE extracts the header and
and data, leaving plain BGI data ("Putimage" format).
* CYCLE.C demonstrates color cycling, a nice effect.
A graphic is provided for use with it (CYCLE.LBM).
To see it run, compile CYCLE.C with Turbo C and
convert CYCLE.LBM to a Full Screen MJB image using
PCX2BGI. Turbo Pascal programmers may be interested
in the source to find out how to load a full screen
image and how to color cycle.

LAST MINUTE BUG NOTICED:
If you try to save a partial image longer than about 550 pixels
across, it won't save.


Files in PCX2BGI.ZIP:
PCX2BGI DOC - Documentation for PCX2BGI.EXE
PCX2BGI EXE - Converts pictures to BGI images
SHOWMJB EXE - Shows a MJB file. Source in TC.ZIP
MOUTHS PCX - A picture with images to try out
LETTERS PCX - Another picture to experiment with
TC ZIP - For Turbo C users
TP ZIP - For Turbo Pascal users


*END OF FILE*


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : 2BGI.ZIP
Filename : PCX2BGI.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/