Turing Logo  

Designed for computer science instruction, Turing is simply the easiest, most fun, and most effective way of teaching programming concepts.


Quick Links
Home page of Holt Software Associates  | Home page of the Turing Programming Language, the fastest way to teach programming concepts  | Home page of Holt Software's Java products  | Home page of Ready to Program with Java(tm) Technology, a Java development environment designed for education  | Information about Holt Software's courses for teachers  | Information about how to contact Holt Software  | Information about how students can purchase Holt Software's books and software  | Information about how schools and bookstores can purchase Holt Software's books and software

Importing Graphics into Turing


This document contains information about how to import different graphics formats into Turing

Various versions of Turing have the ability to import graphics files created by external programs. This allows users to create artwork for their program using graphics programs such as Corel Draw or ClarisWorks and then use the resulting file in their Turing or OOT program.

At the present time, there is no universal format that all versions of Turing can read. Thus it may be necessary to convert an image into a different format for a particular platform. In general, it's advised that you look at what format is needed for a particular version of Turing and, if possible, save the picture in that format. This is because some conversion programs don't work perfectly.

The following table illustrates the different import formats required. Click on the software to see how to import graphics for that particular platform.

Software Graphics Formats Accepted
WinOOT 3.1.1 and Turing 4.0 BMP
MacOOT PICT

Importing BMP files in WinOOT

The BMP graphics format is the general interchange format on the Microsoft Windows. Most Windows graphics programs will save images as BMP.

To display BMP format files in WinOOT, you use the Pic.ScreenLoad procedure. Pic.ScreenLoad has the following definition.

        procedure Pic.ScreenLoad (filename : string, x, y, mode : int)
  
filename The name of the file to be loaded.
x, y The lower left corner of the picture.
mode The mode to display the picture in. One of picCopy, picXOR, picMerge or picUnderMerge.

Under WinOOT 3.1.1 and Turing, the picture is displayed to the window using the windows current palette (which is 256 colours by default). While this means that images won't be rendered perfectly (a picture with 200 shades of green will be rendered as having some 16 or 32 shades of green), it does mean that multiple BMPs can be displayed at once, without the colour palette being changed each time.

The other method of reading a file is to load the image into a pic, getting a picID and then using Pic.Draw to display it. This is done using the Pic.FileNew procedure.

        function Pic.FileNew (filename : string) : int
  
filename The name of the file to be loaded.
Returns The picID that can be passed to other procedures in the Pic module.

Importing PICT files in MacOOT

The PICT graphics format is the general interchange format on the Macintosh. Most Macintosh graphics programs will save images as PICT.

To display PICT format files in MacOOT, you use the Pic.ScreenLoad procedure. Pic.ScreenLoad has the following definition.

        procedure Pic.ScreenLoad (filename : string, x, y, mode : int)
  
filename The name of the file to be loaded.
x, y The lower left corner of the picture.
mode The mode is ignored in MacOOT.

The picture is displayed in the window using the current graphics mode for the output window. This means that the picture's palette is mapped to the current palette for the window.
[ Turing Home ] * [ Top of Page ] * [ Feedback ]