Perfect Sync logoPerfect Sync
Graphics Tools

Graphics Tools
Drawing Functions

Actual function (method/property) names are shown in This Color.

These features are available in both the Standard and Pro versions
of Graphics Tools Version 2, except as noted.

Getting Started

The OpenGfx function is used to create graphics windows.  Graphics Tools Standard can create up to four (4) graphics windows per program, and Graphics Tools Pro can create up to 256.  Each window has its own pen, brush, font, and gradient, and most Graphics Tools "option" settings can be specified on a window-by-window basis.  Many different window-border styles can be created, including raised, sunken, "bump", caption, and more!  (VB programmers can simply drop a graphics window on a form without using OpenGfx.)

GfxCLS (Graphics CLS) erases a graphics window using a color that you specify.

DrawFrom is used to specify the starting location of most drawing operations, and MoveLPR tells Graphics Tools to do things like "move the starting location x units to the right".

DrawTo and DrawLine can be used to draw straight lines, based on starting and ending locations. DrawAngle can be used to draw a line based on an angle and a distance. The DrawMultiLine function draws several lines at the same time, based on an array of points. Great for graphs!

DrawPixel sets the color of a single pixel, and PixelColor reports the current color of a pixel.

DrawRect is used to draw rectangles, DrawArea clears a rectangular area of the graphics window, DrawFocus draws erasable "focus rectangles", and DrawSoftRect draws rectangles with rounded corners.

DrawCircle and DrawEllipse are used to draw circles and ellipses (ovals).  Graphics Tools Pro adds the DrawEllipseRotated function, which can draw an ellipse rotated to any angle.

DrawArc draws portions of circles and ellipses. DrawChord adds a line that connects the endpoints of an arc, and DrawPie adds lines that connect the endpoints to the center of the figure. Perfect for drawing Pie Charts!

DrawCube draws 3D cubes, boxes, and bars of any shape and size.  DrawCylinder draws 3D cylinders and disks -- also great for bar charts! -- and DrawWedge draws "wedges" for things like 3D pie charts.  (Please note that Graphics Tools is not a Charting and Graphing toolkit, it is a Drawing and Graphics toolkit.  It can, however, be used to create a wide variety of high-quality images, including Charts and Graphs.) 

Graphics Tools Pro adds the DrawTube function, which draws realistic tubes when used with an appropriate Gradient.

Speaking of Gradients...  You can save and load ready-to-use Gradients with the GradientSave and GradientLoad functions, tell Graphics Tools which figures to fill with the GradientBrush function, design and "tweak" your own Gradients with GradientValue, and even access the colors of gradient one-by-one with the GradientColor function.

DrawPolygon draws simple or complex polygons, based on an array of points that you provide. DrawBezier is similar, except that Bezier Curves are drawn.

DrawPgram draws a parallelogram or rhombus (remember geometry class?) and DrawXagon draws x-sided figures like triangles, squares, pentagons, hexagons, and octagons, rotated to any angle. The DrawXagon function can also draw "star" shaped figures like pentagrams and x-pointed stars.

DrawFlood fills areas of the graphics window with a certain color or bitmap pattern. Both "flood-to-border" and "flood-surface" modes are supported.

Display Image Files

The DisplayBitmap function can display standard Windows bitmap files (or embedded resources) in their original size, and StretchBitmap can be used to enlarge or reduce an image. CropBitmap allows you to enlarge or reduce a portion of a bitmap. All of these functions support horizontal and vertical "flipping", many different display modes (including XOR drawing), and single-color loading.

The DisplayIcon, DisplayCursor, StretchIcon, and StretchCursor functions allow you to work with Windows icons and cursors.  Use one of the "stock" images that Windows provides, embed icons and cursors directly into your program, or load icons and cursors from standard-format disk files. (Thousands of free icon/cursor images are available on the internet.)  The AnimateCursor and AnimateIcon functions can even be used to play ANI files!  Graphics Tools Pro adds the AutoPlayCursor and AutoPlayIcon functions, and AutoPlayControl can be used to pause and resume auto-play images.

The DisplayImage and StretchImage functions allow you to display images files using any format that Windows supports including (on most systems) Windows MetaFiles, JPEGs, and others.  (Because of restrictions imposed by the patent-holder, GIF files are not currently supported by Graphics Tools.)

The Graphics Tools Pro DisplayJPEG, StretchJPEG, and CropJPEG functions support the use of JPEG images on any system, regardless of whether or not Windows is configured to support JPEG files.

GET/PUT Style Graphics

Graphics Tools allows the use of two or more graphics windows in the same program, and the DisplayWindow, StretchWindow, and CropWindow functions can be used to copy the contents (or a portion of the contents) of one window into another.  XOR copying is supported, so you can create "sprites" in a hidden graphics window and display them in a visible one.

Windows Screen Elements

The DrawButton function can be used to draw familiar Windows screen elements like pushbuttons, radio buttons, and checkboxes, all in a variety of states. And DrawFrame can be used to create raised, sunken, etched, and "bump" lines and rectangles.

Automatic "Scaling" Functions

With Graphics Tools, you'll never have to worry about the Windows desktop resolution (800x600 etc.) or how large your graphics window is, or anything else! You can simply draw inside a "world" that is always 1024x1024 (or any other scale that you prefer), and Graphics Tools will perform all of the size and scale conversions that are necessary to display your drawing in the available space.

Define Your Own "World"

Prefer a drawing world where the origin (0,0) is in the middle of the window?  No problem!  Just use the GfxWorld function to tell Graphics Tools what the left, right, top, and bottom limits are, and start drawing.  Use any integer-based coordinate system you like!

Sixteen Different Drawing Modes

All 16 of the standard Windows Drawing Modes are supported by the GfxDrawMode function, including Opaque Drawing (the default), several Color Merge and Color Mask modes (where the drawing colors and the background are combined in various ways), and XOR Drawing, which allows lines and figures to be "un-drawn" at a later time.

The "TempDraw" Mode

Graphics Tools also supports "temporary" drawing. Once you activate the TempDraw mode, future drawing operations can be easily erased, leaving only the "permanent" parts of your drawing. Then you can turn off the TempDraw mode and return to normal operation.  And the TempErase function can be used to erase all or part of the temporary image. The TempDraw system is great for "rubber-banding"! 

Easy-To-Use Common Graphics Dialogs

The SelectGfxFile function provides a standard open-file dialog that you can use for selecting bitmaps, icons, cursors, JPEGs, or just about any other type of image file.

SelectGfxColor provides an easily managed "choose a color" dialog.  You can pre-define up to 16 custom colors with the CustomColor function, and allow the user to modify them.

Easy Graphics Window Management

Create a graphics window with OpenGfx, then show, hide, freeze, or unfreeze it with the GfxWindow function. Change dozens of options with GfxOption, and use the GfxLoc function to save and restore drawing locations.

Graphics Tools Pro allows the creation of sizable and movable graphics windows, and the GfxResize, GfxMove, and GfxScroll functions let your applications control the windows programmatically.  (You can allow the user to resize and move a graphics window, using the mouse.)

Tool Creation Functions

Pens (which are used to draw lines and shapes) can be created and modified with the Pen, PenColor, PenStyle, and PenWidth functions.

Brushes (which are used to fill shapes) can be created and modified with the Brush, BrushColor, BrushHatch, and BrushStyle functions, and the BrushBitmap function tells Graphics Tools to fill shapes using an existing bitmap.

Fonts can be created and modified with the GfxFont, GfxFontName, GfxFontColor, GfxFontHeight, GfxFontWidth GfxFontSize, GfxFontWeight, and GfxFontAngle functions, and effects like underlining and italics can be added with GfxFontEffects.

Impressive Text Effects

DrawTextBox and DrawTextRow can display text in virtually any font that Windows can produce. You can use dozens of different fonts all at the same time.  Graphics Tools can draw text with shadows, outlines, and automatic edge coloring, as well as "embossing" effects, horizontal and vertical centering, character-by-character animation, printing at any angle, and much more.

Graphics Tools Pro adds an entirely new dimension to text effects with Gradient-Filled Text.

Create Standard Windows Image Files

The SaveGfxWindow function allows you to save the contents of an entire graphics window in a standard-format bitmap file. Just specify a file name, and Graphics Tools will do the rest! Or use the SaveGfxArea function to save just part of an image. 

The SaveGfxMode function tells Graphics Tools to create monochrome, 16-color, 256-color, 64k-color, or TrueColor bitmap files.

And Graphics Tools Pro adds the ability to save standard-format JPEG files on any computer system, using 4:1:1 or 4:2:2 sampling, in 99 different quality levels.

Print Your Graphics Tools Images

Graphics Tools Pro includes the GfxPrintWindow and GfxPrintArea, to print all or part of whatever you draw.  Standard Printer Setup and Page Setup (with WYSIWYG) dialogs can be displayed with the GfxPrintSetup and GfxPrintPageSetup functions.  The status of the most recent print job can be monitored with GfxPrintStatus, and utility functions called GfxPrintParam and GfxPrintDefaults are also provided.

Create Complex Images with "Clip Areas"

If you use the Graphics Tools Pro GfxClipArea function, you can define areas of a graphics window where drawing is and isn't allowed.  This makes things like drawing half-circles a snap, not to mention much more complex figures.

Drag-Drop Support

Graphics windows that are created with Graphics Tools Pro can be the target of drag-and-drop operations.  With the GfxDroppedFiles function it's easy to write a program that allows you to drag an image file from Explorer onto a graphics window, and have the image appear wherever it is dropped.

Use Windows Colors or "HSW" Colors

Graphics Tools supports 100% of the colors that your monitor and video card support, using industry-standard Windows Color values. Or you can use the Graphics Tools HSW color system to specify colors by "Hue, Saturation, and Whiteness".  HSW colors make producing colors like Pink, Orange, and Yellow much easier than RGB colors.

Create "Holes" in the Graphics Window

The Graphics Tools DrawHole function is used to create "transparent" areas of the graphics window, to allow the parent window to show through. With Console Tools Plus Graphics, you can specify console rows and columns where PRINT, COLOR, and LOCATE can be used.

Lots of Convenience Functions

HighlightColor creates highlighted and shaded versions of the colors that you specify..

SystemColor gives you easy access the Windows "Appearance" settings, so you can find out (for example) what color the current user prefers for text and backgrounds.

Okay, we have rambled on almost long enough.  Graphics Tools also includes functions called ActualColor, BlueValue, GreenValue, RedValue, HueValue, SaturationValue, WhitenessValue, BitmapParam, CursorParam, IconParam, ImageParam, CalcPoint, GfxSyncCursor, GfxCaption, GfxRefresh, GfxUpdate, GfxBkgdColor, GfxBkgdMode, GfxMetrics, GfxX, GfxY, hGfx, hGfxFont, HSWtoRGB, RGBtoHSW, FillHole, MouseOver, MouseOverX, MouseOverY, PolyFillMode, UserDraw, GfxConvert, GfxCursor, GfxToolsVersion, GfxIsOpen, GfxLPR, GfxResponse, GfxSquareness, InitGraphicsTools, UseGfxWindow, and WedgeOrder.  Graphics Tools Pro adds functions called JpegParam, InitGradientHSW, and InitGradientRGB.

What Can I Draw With All Of These Functions?

Perfect Sync logo

UPDATED 19 NOV 2006 EP    



About Us Contact Us Legal Stuff Main Page Site Search
© Copyright 2006 Perfect Sync, Inc. All rights reserved