GraphiX/FP Help
~~~~~~~~~~~~~~~
GraphiX 4.00 for FreePascal 1.0.4
Date: March 12th, 2001
Contents of the GraphiX - Help
==============================
General Information
===================
-----------------------------------------------------------------------
Please tell me any bugs which occur in this helpfile
i.e. wrong links, missing descriptions ...
-----------------------------------------------------------------------
The Units
=========
GXTYPE ..... types for GRAPHIX
GRAPHIX .... main unit
GX2D ....... extented 2D routines
GX3D ....... 3D drawing routines
GX3DTYPE ... types for GX3D
GXIMG ...... image loaders and image savers
GXIMEFF .... image effects
GXMOUSE .... mouse unit for INT 33h driver
GXTEXT ..... new text output unit
GXFONT ..... old text output Unit
GXMEDIA .... animtion and video player
GXDRW ...... image drawing unit
GXCRT ...... GraphiX Crt unit
GXTTF ...... GraphiX TrueType Font Unit
Other Usefull Units
===================
GXCRTEXT ... misc routines
See also:
Welcome to GraphiX
Alphabetical List
Units Overview
Welcome to GraphiX
==================
-----------------------------------------------------------------------
G R A P H I X / F P v 4 . 0 0 - (c) 1997-2000 Michael Knapp
Date: March 12th, 2001 contact: mknapp@gmx.at
Graphics-Library for FreePascal Targets: GO32V2/WIN32/LINUX
-----------------------------------------------------------------------
Please tell me any bugs which occur in this helpfile
i.e. wrong links, missing descriptions ...
-----------------------------------------------------------------------
Requirements
============
* FreePascal 1.0.4 or later
* GO32V2: x86-System with MS-DOS-compatible OS
* Win32: Windows 95/98/2000/NT4 with DirectX3
* Linux: i386, with SVGAlib
* absolute minimum
- 386SX+387
- 4MB RAM
- ISA-SVGA-graphics card with 8bit DAC, 512KB, VESA 1.2
* minimum
- 486SX, 486DX, 486DX2, 486DX4
- 16MB RAM
- VLB- or PCI-SVGA-graphics card with 8/15/16/24/32bit-DAC, 2MB, LFB, VESA 2.0
* recommended
- AMD K5 - Cyrix 6x86 - Intel Pentium
- 32MB RAM
- PCI-SVGA-graphics card with 8/15/16/24/32bit-DAC, 4MB, VESA 2.0
* optimum
- AMD K6/K7 - Cyrix 6x86MX - IDT Winchip C6 - Intel Pentium MMX/II/III
- 64MB RAM
- PCI- or AGP-SVGA-graphics card with 8/15/16/24/32bit-DAC, 8MB, VESA 2.0
Features
========
= supported resolutions:
- all resolutions
= supported color modes
- 8bit (3:3:2)
- 15bit (5:5:5)
- 16bit (5:6:5)
- 24bit (8:8:8)
- 32bit (8:8:8:8)
= supported drawing methods & techniques:
- VGA-Window
- Linear Frame Buffer
- Hardware Acceleration
- Double Buffering
- Virtual Buffer Management
= supported standard/hardware
- VESA (1.2, 2.0) ............... bank, LFB
- 3Dfx Voodoo 3 (Banshee) ....... bank, LFB, hardware
- ARK Logic ..................... bank, LFB, hardware
- ATI (mach8, mach32, mach64) ... bank, LFB, hardware
- Cirrus Logic (5420 - 5485) .... bank, LFB
- Matrox (2x64W, 1x64SG) ........ bank, LFB, hardware
- S3 (Vision, Trio, ViRGE) ...... bank, LFB, hardware
- SiS (62xx, 6326) .............. bank, LFB, hardware
- Trident Microelectronics ...... bank, LFB, hardware
- Tseng Labs (not ET3000) ....... bank, LFB
= supported instruction sets
- 8086/80186/80286/80386-instruction set
- MMX-instruction set is used on MMX-capable-processors
(Pentium MMX, Pentium II, AMD K6, AMD K6-2, ...)
= loading-support for image formats
- BMP - Windows Bitmap - 1bit, 4bit, 8bit and 24bit, - uncompressed, RLE4, RLE8
- GIF - Graphics Interchange Format - 4bit and 8bit
- CUR - Windows Cursor - 1bit, 4bit, 8bit and 24bit - all sizes - uncompressed, RLE4, RLE8
- ICO - Windows Icons - 1bit, 4bit, 8bit and 24bit - all sizes - uncompressed, RLE4, RLE8
- JPG - grayscale, RGB - standard/extended/progressive huffmann encoded (SOF0,SOF1,SOF2)
- PCX - Zsoft Paintbrush - 1bit, 4bit, 8bit, 8bit-grayscale and 24bit
- PNG - Portable Network Graphics - all types (PNG Specification ver 1.0)
- PBM/PGM/PPM - Portable Bitmap/Gray/Pixel Map - ASCII & Binary
- TGA - Truevision Targa - 8bit, 16bit, 24bit and 32bit uncompressed & RLE, bottom-up and top-down
- TIF - Tagged Image Format - bilevel, indexed, RGB, CMYK - uncompressed, packbits and LZW
= saving-support for image formats
- BMP - Windows Bitmap - 24bit
- PPM - Portable Pixel Map - ASCII
- TGA - Truevision Targa - 24bit uncompressed
Go to
Contents
Alphabetical List
Units Overview
Alphabetical List
=================
+---+----------------------------------------
| A | averageimage
+---+
+---+----------------------------------------
| B | bar
+---+ barXOR
blendimageALPHA
blendimageALPHAcolor
blendimageALPHAimage
blendimageMASK
blendimageMASKcolor
blendimageMASKimage
+---+----------------------------------------
| C | captureimage
+---+ circle
circlefill
clearimageflags
clearprogressmonitor
cloneimage
composeimage
composeimageC
copyimage
CopySurface
createimage
createimageWH
CreateMousePointer
CreateSurface
createpattern
+---+----------------------------------------
| D | DefaultMousePointer
+---+ DisableSurfaceFlipping
DisableMouse
DestroySurface
+---+----------------------------------------
| E | EditText
+---+ ellipsefill
EnableSurfaceFlipping
EnableMouse
+---+----------------------------------------
| F | fillimage
+---+ filterimage
flipimageH
flipimageV
FlipSurface
+---+----------------------------------------
| G | GetGraphiX
+---+ getgraphwin
getimageheight
getimage
getimageflags
getimagetransparencycolor
getimagewidth
getrgbcolor
getmaxX
getmaxY
getpixel
GraphiX Flags
graphwin
+---+----------------------------------------
| H |
+---+
+---+----------------------------------------
| I | ig_xxxx - constants
+---+ imageADDcolor
imageSUBcolor
imageSADDcolor
imageSSUBcolor
imageANDcolor
imageORcolor
imageXORcolor
imageADDimage
imageSUBimage
imageSADDimage
imageSSUBimage
imageANDimage
imageORimage
imageXORimage
imagebar
imagegetpixel
imagebarXOR
imageline
imagelineh
imagelinev
imagelineXOR
imagemoverect
imagegetimage
imageputbitmap
imageputimage
imageputimageC
imageputimagepart
imageputimagepartC
imageputpixel
imagerectangle
imagezoomimage
imagezoomimageC
InitGraphiX
InitMouse
InitMousePointer
InitText
IsModeAvailable
IsMouseInArea
+---+----------------------------------------
| J |
+---+
+---+----------------------------------------
| K |
+---+
+---+----------------------------------------
| L | line
+---+ lineh
linepattern
linepatternXOR
lineto
linev
lineXOR
loadimagefile
loadimagestream
+---+----------------------------------------
| M | maxgraphwin
+---+ mosaicimage
MouseButton
MouseCoords
MouseOff
MouseOn
moverect
moveto
multipolygon
+---+----------------------------------------
| N |
+---+
+---+----------------------------------------
| O | outunicode
+---+
+---+----------------------------------------
| P | pimage
+---+ polygon
popgraphwin
pushgraphwin
putbitmap
putimage
putimageC
putimagepart
putimagepartC
putpixel
+---+----------------------------------------
| Q |
+---+
+---+----------------------------------------
| R | rectangle
+---+ ReInitMouse
Destroyimage
DestroyMousePointer
Destroypattern
ResetDrawMouseCursorProc
ResetMousePointer
retrace
retraceend
retracestart
rgbcolor
rgbcolor32
rotateimage
+---+----------------------------------------
| S | saveimageBMP
+---+ saveimagePPM
saveimageTGA
scaleimage
SetActiveSurface
SetDrawMouseCursorProc
setfillstyle
setimageflags
setimagetransparencycolor
SetModeGraphiX
SetMouseArea
SetMousePointer
SetMousePosition
SetProgressMonitor
subgraphwin
+---+----------------------------------------
| T |
+---+ TFont.LoadFont
TFont.outtext
TFont.setfontdirection
TFont.setfontstyle
TFont.setimage
TFont.textwidth
TFont.textheight
TFont.fontheight
TFont.RemoveFont
TFontCHR.setfontstyle
Tmedia.CloseMedia
Tmedia.EndofMedia
Tmedia.GetCurFrame
Tmedia.GetDuration
Tmedia.GetFrameTime
Tmedia.GetHeight
Tmedia.GetNumFrame
Tmedia.GetWidth
Tmedia.GrabFrame
Tmedia.OpenMedia
Tmedia.SeekMedia
Tmedia.SetRenderMode
Tmedia.StartMedia
Tmedia
TmediaANI
TmediaAVI
TmediaFLC
TmediaGIF
TmediaMOV
TMousePointer
TPoint2D
TPoint3D
TRender
triangle_flat
triangle_gouraud
triangle_textured
TSurface
+---+----------------------------------------
| U | unicodeheight
+---+ unicodelength
UserDataToImageRGB
UserDataToImagePAL
+---+----------------------------------------
| V | vergraphix
+---+
+---+----------------------------------------
| W | WaitButtonPressed
+---+ WaitButtonReleased
WhatIsImageStream
WhatIsImageFile
+---+----------------------------------------
| X |
+---+
+---+----------------------------------------
| Y |
+---+
+---+----------------------------------------
| Z | zoomimage
+---+ zoomimageC
---------------------------------------------
See also:
Contents
Welcome to GraphiX
Units Overview
Units Overview
==============
GXTYPE
======
Types, Constants, Vars
----------------------
TImage
TPattern
GRAPHIX
=======
Types, Constants, Vars
----------------------
vergraphix
vergx### - constants
ig_### - constants
Procedures, Functions
---------------------
GetGraphiX putpixel
InitGraphiX getpixel
SetModeGraphiX line
IsModeAvailable lineXOR
InitText moveto
lineto
GetNumPages lineh
EnableDoubleBuffering linev
DisableDoubleBuffering rectangle
SetActivePage bar
SetVisualPage barXOR
SetFrontBuffer moverect
SetBackBuffer captureimage
CreateBackBuffer getimage
DestroyBackBuffer putimage
CopyBack2Front putimageC
CopyFront2Back putimagepart
CopyBack2Back putimagepartC
pageflip zoomimage
zoomimageC
putbitmap
linepattern
linepatternXOR
setfillstyle
setfillpattern createimage
createpattern createimageWH
destroypattern destroyimage
cloneimage
retrace copyimage
retracestart getimagewidth
retraceend getimageheight
graphwin setimageflags
subgraphwin clearimageflags
maxgraphwin getimageflags
pushgraphwin setimagetransparencycolor
popgraphwin getimagetransparencycolor
getgraphwin
getrgbcolor
getmaxX rgbcolor
getmaxY rgbcolor32
GraphiX Flags
CreateSurface
DestroySurface
SetActiveSurface
EnableSurfaceFlipping
DisableSurfaceFlipping
CopySurface
FlipSurface
TSurface
Unit GX2D
=========
Drawing - Routines
==================
Procedures, Functions
---------------------
circle
circlefill
ellipsefill
polygon
multipolygon
Unit GX3DTYPE
=============
Types, Constants, Vars
----------------------
TPoint2D
TPoint3D
TRender
Unit GX3D
=========
Procedures, Functions
---------------------
triangle_flat
triangle_gouraud
triangle_textured
Unit GXIMG
==========
Procedures, Functions
---------------------
LoadImageStream SetProgressMonitor
LoadImageFile ClearProgressMonitor
SaveImageBMP
SaveImagePPM WhatIsImageStream
SaveImageTGA WhatIsImageFile
Unit GXIMEFF
============
Procedures, Functions
---------------------
blendimageALPHA imageADDcolor
blendimageALPHAcolor imageSUBcolor
blendimageALPHAimage imageSADDcolor
blendimageMASK imageSSUBcolor
blendimageMASKcolor imageANDcolor
blendimageMASKimage imageORcolor
imageXORcolor
fillimage imageADDimage
composeimage imageSUBimage
composeimageC imageSADDimage
flipimageH imageSSUBimage
flipimageV imageANDimage
scaleimage imageORimage
rotateimage imageXORimage
mosaicimage
averageimage UserDataToImageRGB
filterimage UserDataToImagePAL
Unit GXMOUSE
============
Types, Constants, Vars
----------------------
TMousePointer
DefaultMousePointer
Procedures, Functions
---------------------
InitMouse MouseOn
ReInitMouse MouseOff
EnableMouse MouseCoords
DisableMouse MouseButton
CreateMousePointer SetMousePosition
DestroyMousePointer SetMouseArea
InitMousePointer
SetMousePointer IsMouseInArea
ResetMousePointer
SetDrawMouseCursorProc WaitButtonReleased
ResetDrawMouseCursorProc WaitButtonPressed
Unit GXTEXT, GXTTF
==================
Types, Constants, Vars Procedures, Functions
---------------------- ---------------------
TFont TFont.LoadFont
TFontVGA TFont.out{text|unicode}
TFontCHR TFont.setfontdirection
TFontFNT TFont.setfontstyle
TFontTTF TFont.{text|unicode}width
TFont.{text|unicode}height
TFont.fontheight
TFont.RemoveFont
TFont.setimage
EditText
Unit GXMEDIA
============
Types, Constants, Vars Procedures, Functions
---------------------- ---------------------
Tmedia Tmedia.OpenMedia
TmediaAVI Tmedia.StartMedia
TmediaFLC Tmedia.SeekMedia
TmediaGIF Tmedia.GrabFrame
TmediaMOV Tmedia.GetFrameTime
TmediaANI Tmedia.GetNumFrame
Tmedia.GetCurFrame
Tmedia.GetDuration
Tmedia.GetWidth
Tmedia.GetHeight
Tmedia.EndofMedia
Tmedia.CloseMedia
Unit GXDRW
==========
Unit GXCRT
==========
Unit GXIMGDRW
=============
See also:
Contents
Welcome to GraphiX
Alphabetical List
GetGraphiX (Unit GRAPHIX)
=========================
detects and selects a graphics device
*) If ig_detect is used, first GetGraphiX will check for
any graphics device if the detection fails then GetGraphiX
for checks for VBE if the VBE-check fails, VGA mode 13h will be selected
*) If a graphics device specific constant is selected, first
GetGraphiX checks if the device is available - if not GetGraphiX
checks for VBE - if the VBE-check fails, ig_vga will be selected
*) If 'ig_vesa' is selected, GetGraphiX checks whether VBE is available
Declaration:
PROCEDURE GetGraphix(init:longint);
See also:
ig_xxxx - constants
InitGraphiX
SetModeGraphiX
IsModeAvailable
InitGraphiX (Unit GRAPHIX)
==========================
detects and selects a graphics device
returns TRUE if the action successful otherwise FALSE
*) If ig_detect is used, first GetGraphiX will check for
any graphics device if the detection fails then GetGraphiX
for checks for VBE if the VBE-check fails, VGA mode 13h will be selected
*) If a graphics device specific constant is selected, first
GetGraphiX checks if the device is available - if not GetGraphiX
checks for VBE - if the VBE-check fails, ig_vga will be selected
*) If 'ig_vesa' is selected, GetGraphiX checks whether VBE is available
Declaration:
FUNCTION InitGraphix(init,memmode:longint):boolean;
Example:
USES crt,graphix;
BEGIN
IF InitGraphiX(ig_vesa,ig_lfb) THEN { selects VESA with LFB }
BEGIN
IF SetModeGraphiX(640,480,ig_col8) THEN { switches to mode 640x480x8bit }
BEGIN
bar(0,0,getmaxX,getmaxY,rgbcolor(255,255,255)); { fills the screen with white color }
rectangle(50,50,getmaxX-50,getmaxY-50,0); { with a black rectangle }
END
ELSE
BEGIN
writeln('Cannot switch to graphics mode');
END;
END
ELSE
BEGIN
writeln('Cannot initialize graphics device');
END
readkey;
END;
See also:
ig_xxxx - constants
GetGraphiX
SetModeGraphiX
IsModeAvailable
SetModeGraphiX (Unit GRAPHIX)
=============================
switches to the given graphics mode
returns TRUE if the mode switching was successful otherwise FALSE
Declaration:
FUNCTION SetModeGraphix(xres,yres,col:longint):boolean;
See also:
ig_xxxx - constants
GetGraphiX
InitGraphiX
IsModeAvailable
IsModeAvailable (Unit GRAPHIX)
==============================
checks whether the given graphics mode is availaible
returns TRUE if the mode switching is available otherwise FALSE
Declaration:
FUNCTION IsModeAvailable(xres,yres,col:longint):boolean;
See also:
ig_xxxx - constants
GetGraphiX
InitGraphiX
SetModeGraphiX
InitText (Unit GRAPHIX)
=======================
switches to textmode 03h (80x25 color)
Declaration:
PROCEDURE InitText;
putpixel (Unit GRAPHIX)
=======================
Draws a pixel at (x,y) with color (f)
Declaration:
PROCEDURE putpixel(x,y,f:longint);
getpixel (Unit GRAPHIX)
=======================
returns a pixel from (x,y) in the current color format
Declaration:
FUNCTION getpixel(x,y:longint):longint;
line (Unit GRAPHIX)
===================
draws a line from (x1,y1) to (x2,y2) with the color (f)
Declaration:
PROCEDURE line(x1,y1,x2,y2,f:longint);
lineXOR (Unit GRAPHIX)
======================
draws a line from (x1,y1) to (x2,y2)
the screen contents are XORed with the color (f)
Declaration:
PROCEDURE lineXOR(x1,y1,x2,y2,f:longint);
moveto (Unit GRAPHIX)
=====================
Sets to current draw-position to (x,y)
Declaration:
PROCEDURE moveto(x,y:longint);
See also:
lineto
lineto (Unit GRAPHIX)
=====================
draws a line with the color (f) to (x,y) and
sets the current draw-position to (x,y)
Declaration:
PROCEDURE lineto(x,y,f:longint);
See also:
moveto
lineh (Unit GRAPHIX)
====================
draws a horizontal line from (x1,y) to (x2,y) with
the color (f)
Declaration:
PROCEDURE lineh(x1,x2,y,f:longint);
linev (Unit GRAPHIX)
====================
draws a vertical line from (x,y1) to (x,y2) with
the color (f)
Declaration:
PROCEDURE linev(x,y1,y2,f:longint);
rectangle (Unit GRAPHIX)
========================
draws a empty rectangle from upper-left (x1,y1) to bottom-right (x2,y2)
corner with the color (f)
Declaration:
PROCEDURE rectangle(x1,y1,x2,y2,f:longint);
bar (Unit GRAPHIX)
==================
draws a filled rectangle from upper-left (x1,y1) to bottom-right (x2,y2)
corner with the color (f)
Declaration:
PROCEDURE bar(x1,y1,x2,y2,f:longint);
barXOR (Unit GRAPHIX)
=====================
draws a filled rectangle from upper-left (x1,y1) to bottom-right (x2,y2)
corner and XORs the screen color with the color (f)
Declaration:
PROCEDURE barXOR(x1,y1,x2,y2,f:longint);
moverect (Unit GRAPHIX)
=======================
copies a given area (upper-left (x1,y1) to bottom-right (x2,y2))
corner) to (x,y)
Declaration:
PROCEDURE moverect(x1,y1,x2,y2,x,y:longint);
getimage (Unit GRAPHIX)
=======================
copies an screen area
into a memory buffer (img)
Note: Enough memory must be allocated
Declaration:
PROCEDURE getimage(x,y:longint;img:pimage);
See also:
captureimage
putimage
putimageC
putimagepart
putimagepartC
zoomimage
zoomimageC
capturetimage (Unit GRAPHIX)
============================
copies a given area (upper-left (x1,y1) to bottom-right (x2,y2))
corner) into a memory buffer (img)
Note: Enough memory must be allocated
Declaration:
PROCEDURE captureimage(x1,y1,x2,y2:longint;img:pimage);
See also:
getimage
putimage
putimageC
putimagepart
putimagepartC
zoomimage
zoomimageC
putimage (Unit GRAPHIX)
=======================
draws an image from a memory buffer (img) to (x,y)
Declaration:
PROCEDURE putimage(x,y:longint;img:pimage);
See also:
getimage
captureimage
putimageC
putimagepart
putimagepartC
zoomimage
zoomimageC
putimageC (Unit GRAPHIX)
========================
draws an image from a memory buffer (img) to (x,y)
with transparency - image pixels, which match the transparency-color
are not drawn
Declaration:
PROCEDURE putimageC(x,y:longint;img:pimage);
See also:
getimage
captureimage
putimage
putimagepart
putimagepartC
zoomimage
zoomimageC
putimagepart (Unit GRAPHIX)
===========================
draws part (xi1,yi1)-(xi2,yi2) of an image
from a memory buffer (img) to (x,y)
Declaration:
PROCEDURE putimagepartC(x,y,xi1,yi1,xi2,yi2:longint;img:pimage);
See also:
getimage
captureimage
putimageC
putimagepartC
zoomimage
zoomimageC
putimagepartC (Unit GRAPHIX)
============================
draws part (xi1,yi1)-(xi2,yi2) of an image
from a memory buffer (img) to (x,y)
with transparency - image pixels, which match
the transparency-color are not drawn
Declaration:
PROCEDURE putimagepartC(x,y,xi1,yi1,xi2,yi2:longint;img:pimage);
See also:
getimage
captureimage
putimage
putimageC
putimagepart
zoomimage
zoomimageC
zoomimage (Unit GRAPHIX)
========================
draws an image from a memory buffer (img) with resizing to (x1,y1)-(x2,y2)
Declaration:
PROCEDURE zoomimage(x1,y1,x2,y2:longint;img:pimage);
See also:
getimage
captureimage
putimage
putimageC
putimagepart
putimagepartC
zoomimageC
zoomimageC (Unit GRAPHIX)
=========================
draws an image from a memory buffer (img) with resizing to (x1,y1)-(x2,y2)
with transparency - image pixels, which match the transparency-color
are not drawn
Declaration:
PROCEDURE zoomimageC(x1,y1,x2,y2:longint;img:pimage);
See also:
getimage
captureimage
putimage
putimageC
putimagepart
putimagepartC
zoomimage
putbitmap (Unit GRAPHIX)
========================
Draws an monochrome bit-map (bitrmap) with the
width (w) and height (h) and (bpl) bytes per line
to (x,y) with the color (col)
Declaration:
PROCEDURE putbitmap(x,y,w,h,bpl,col:longint;var bitmap);
linepattern (Unit GRAPHIX)
==========================
draws a patterned (pat) with the length (bits) line
from (x1,y1) to (x2,y2) with the color (f)
(bits) should be in the range 1..31
Declaration:
PROCEDURE linepattern(x1,y1,x2,y2,f,pat,bits:longint);
linepatternXOR (Unit GRAPHIX)
=============================
draws a patterned (pat) with the length (bits) line
from (x1,y1) to (x2,y2) and XORs the background with
the color (f)
(bits) should be in the range 1..31
Declaration:
PROCEDURE linepatternXOR(x1,y1,x2,y2,f,pat,bits:longint);
setfillstyle (Unit GRAPHIX)
===========================
sets the fill-style (fillstyle - fs_solid or fs_pattern)
with or without a pattern
If you have set a pattern before with #2
so you can switch to fs_solid with #1 and
then switch back to the currewnt pattern with #1
Declaration:
#1 PROCEDURE setfillstyle(fillstyle:word);
#2 PROCEDURE setfillstyle(fillstyle:word;var pattern);
createpattern (Unit GRAPHIX)
============================
Allocates memory and creates a pattern using string-data
Example:
VAR mypattern:PPattern;
mypattern:=CreatePattern('+','++++ ',
'++++ ',
'++++ ',
'++++ ',
' ++++',
' ++++',
' ++++',
' ++++');
Declaration:
FUNCTION createpattern(pc:char;b0,b1,b2,b3,b4,b5,b6,b7:tpatternline):PPattern;
Destroypattern (Unit GRAPHIX)
============================
releases the memory allocated by CreatePattern
Declaration:
PROCEDURE Destroypattern(p:PPattern);
retrace (Unit GRAPHIX)
======================
Waits for vertical retrace
Declaration:
PROCEDURE retrace;
See also:
retracestart
retraceend
retracestart (Unit GRAPHIX)
===========================
Waits until vertical retrace starts
Declaration:
PROCEDURE retracestart;
See also:
retrace
retraceend
retraceend (Unit GRAPHIX)
=========================
Waits until vertical retrace ends
Declaration:
PROCEDURE retraceend;
See also:
retrace
retracestart
graphwin (Unit GRAPHIX)
=======================
sets the clipping-window from (x1,y1) upper-left
to (x2,y2) bottom-right
Declaration:
PROCEDURE graphwin(x1,y1,x2,y2:longint);
See also:
subgraphwin
maxgraphwin
getgraphwin
pushgraphwin
popgraphwin
subgraphwin (Unit GRAPHIX)
==========================
sets the output-window clipped by the old clipping window
from (x1,y1) upper-left to (x2,y2) bottom-right
Declaration:
PROCEDURE subgraphwin(x1,y1,x2,y2:longint);
See also:
graphwin
maxgraphwin
getgraphwin
pushgraphwin
popgraphwin
getgraphwin (Unit GRAPHIX)
==========================
retrieves the output-window coordinates
from (x1,y1) upper-left to (x2,y2) bottom-right
Declaration:
PROCEDURE getgraphwin(var x1,y1,x2,y2:longint);
See also:
graphwin
subgraphwin
maxgraphwin
pushgraphwin
popgraphwin
maxgraphwin (Unit GRAPHIX)
==========================
sets the clipping-window from (0,0) upper-left
to (getmaX,getmaxY) bottom-right
Declaration:
PROCEDURE maxgraphwin;
See also:
graphwin
subgraphwin
getgraphwin
pushgraphwin
popgraphwin
getmaxX
getmaxY
pushgraphwin (Unit GRAPHIX)
===========================
pushes the current output-window coordinates onto an internal stack
Declaration:
PROCEDURE pushgraphwin;
See also:
graphwin
subgraphwin
maxgraphwin
getgraphwin
popgraphwin
popgraphwin (Unit GRAPHIX)
==========================
pops the coordinates from an internal stack and the they are
used to set the current output-window
Declaration:
PROCEDURE popgraphwin;
See also:
graphwin
subgraphwin
maxgraphwin
getgraphwin
pushgraphwin
getmaxX (Unit GRAPHIX)
======================
returns the maximum X-coordiante (horizontal)
Declaration:
FUNCTION getmaxX:longint;
See also:
getmaxY
getmaxY (Unit GRAPHIX)
======================
returns the maximum Y-coordiante (vertical)
Declaration:
FUNCTION getmaxY:longint;
See also:
getmaxX
rgbcolor (Unit GRAPHIX)
=======================
converts single RGB values (r), (g) and (b) into the current color layout
Declaration:
FUNCTION rgbcolor(r,g,b:byte):longint
See also:
rgbcolor32
rgbcolor32 (Unit GRAPHIX)
=======================
converts a RGB-longint value (f) into the current color layout
bits 0..7 - blue
bits 8..15 - green
bits 16..23 - red
bits 24..31 - not used
Declaration:
FUNCTION rgbcolor32(f:longint):longint
See also:
rgbcolor
getrgbcolor (Unit GRAPHIX)
==========================
converts the current color-layout (f) into the 8:8:8-RGB-color
bits 0..7 - blue
bits 8..15 - green
bits 16..23 - red
bits 24..31 - not used
Declaration:
FUNCTION getrgbcolor(f:longint):longint
See also:
rgbcolor32
vergraphix (Unit GRAPHIX)
vergx### - constants
=========================
version informaton string
Declaration:
CONST vergxname='GraphiX/FP ';
vergxauthor='Michael Knapp';
vergxmajornum='4';
vergxminornum='00';
vergxrevision='0';
vergxdate='2000/09/22';
vergxcopyright='(c) 1999-2000';
vergraphix=vergxname+' v'+vergxmajornum+'.'+vergxminornum+
' ['+vergxdate+'] '+vergxcopyright+' '+vergxauthor;
ig_### - constants (Unit GRAPHIX)
=================================
ig - I(nit)G(raphiX) - selects the graphics device using
GetGraphiX, InitGraphiX or SetModeGraphiX
Declaration:
CONST
ig_detect = $FFFF;
ig_vga = $F000;
ig_3dfx = $000A;
ig_ark = $0001;
ig_ati = $0009;
ig_cirrus = $0002;
ig_matrox = $0004;
ig_s3 = $0005;
ig_sis = $0006;
ig_trident = $0007;
ig_tseng = $0008;
ig_vesa = $00FF;
ig_bank = $00000001;
ig_lfb = $00000002;
ig_hwa = $00000004;
ig_col8 = $00000100;
ig_col15 = $00000200;
ig_col16 = $00000300;
ig_col24 = $00000400;
ig_col32 = $00000500;
See also:
GetGraphiX
InitGraphiX
SetModeGraphiX
IsModeAvailable
GraphiX Flags (Unit GraphiX)
============================
New GraphiX Flags
General Flags
-------------
CONST
gx_ok returned if action successful
gx_error returned if action fails
Surface Flags
-------------
CONST
gxsf_videomem surface is in display memory
gxsf_offscreenmem surface is in graphics memory
gxsf_sysmem surface is in system memory
CreateSurface (Unit GraphiX)
============================
Creates surface (sf) in video, offscreen or system memory
Returns gx_ok on success, otherwise gx_error
Declaration:
FUNCTION CreateSurface(var sf:PSurface;flags:dword):dword
See also:
GraphiX Flags
CreateSurface
DestroySurface
SetActiveSurface
EnableSurfaceFlipping
DisableSurfaceFlipping
CopySurface
FlipSurface
TSurface
DestroySurface (Unit GraphiX)
=============================
Destroys the surface (sf)
Returns gx_ok on success, otherwise gx_error
Declaration:
FUNCTION DestroySurface(var sf:PSurface):dword;
See also:
CreateSurface
DestroySurface
SetActiveSurface
EnableSurfaceFlipping
DisableSurfaceFlipping
CopySurface
FlipSurface
TSurface
SetActiveSurface (Unit GraphiX)
===============================
Sets output to surface (sf) and changes the clipping window (changeclip)
Returns gx_ok on success, otherwise gx_error
Declaration:
FUNCTION SetActiveSurface(sf:PSurface;changeclip:boolean):dword;
See also:
CreateSurface
DestroySurface
SetActiveSurface
EnableSurfaceFlipping
DisableSurfaceFlipping
CopySurface
FlipSurface
TSurface
EnableSurfaceFlipping (Unit GraphiX)
====================================
Enables Double-Buffering with the back surface (sf)
if flags = 0 then (sf) is used as back surface otherwise
a surface is created according to (flags)
Returns gx_ok on success, otherwise gx_error
Declaration:
FUNCTION EnableSurfaceFlipping(var sf:PSurface;flags:dword):dword
See also:
GraphiX Flags
CreateSurface
DestroySurface
SetActiveSurface
EnableSurfaceFlipping
DisableSurfaceFlipping
CopySurface
FlipSurface
TSurface
DisableSurfaceFlipping (Unit GraphiX)
=====================================
Disables double buffering
if sf <> nil then the surface is destroyed
Returns gx_ok on success, otherwise gx_error
Declaration:
FUNCTION DisableSurfaceFlipping(sf:PSurface):dword;
See also:
CreateSurface
DestroySurface
SetActiveSurface
EnableSurfaceFlipping
DisableSurfaceFlipping
CopySurface
FlipSurface
TSurface
CopySurface (Unit GraphiX)
==========================
Copys data from surface (src) to surface (dst)
Returns gx_ok on success, otherwise gx_error
Declaration:
FUNCTION CopySurface(dsf,ssf:PSurface):dword;
See also:
CreateSurface
DestroySurface
SetActiveSurface
EnableSurfaceFlipping
DisableSurfaceFlipping
CopySurface
FlipSurface
TSurface
FlipSurface (Unit GraphiX)
==========================
Flips surfaces and waits for the vertical retrace
Returns gx_ok on success, otherwise gx_error
Declaration:
FUNCTION FlipSurface(waitforverticalretrace:boolean):dword;
See also:
CreateSurface
DestroySurface
SetActiveSurface
EnableSurfaceFlipping
DisableSurfaceFlipping
CopySurface
FlipSurface
TSurface
TSurface (Unit GraphiX)
=======================
TSurface structure
Declaration:
TYPE PSurface=^TSurface;
TSurface=RECORD
base:pointer;
data:pointer;
size:dword;
flags:dword;
vx1,vy1,vx2,vy2:longint;
END;
See also:
CreateSurface
DestroySurface
SetActiveSurface
EnableSurfaceFlipping
DisableSurfaceFlipping
CopySurface
FlipSurface
TSurface
circle (Unit GX2D)
==================
draws a empty circle with the center (x,y) and
Radius (r) with the color (f)
Declaration:
PROCEDURE circle(x,y,r,f:longint);
circlefill (Unit GX2D)
======================
draws a filled circle with the center (x,y) and
Radius (r) with the color (f)
Declaration:
PROCEDURE circlefill(x,y,r,f:longint);
ellipsefill (Unit GX2D)
=======================
draws a filled ellipse with the center (x,y) and
width (rx) and height (ry) with the color (f)
Declaration:
PROCEDURE ellipsefill(x,y,rx,ry,f:longint);
polygon (Unit GX2D)
===================
draws a filled polygon, which has (z) points, the points are in (p)
with the color (f)
Declaration:
PROCEDURE polygon(var p;z:word;f:longint);
Structure of (p):
array[1..(z)] of RECORD x,y:longint; END;
multipolygon (Unit GX2D)
========================
draws a filled polygon, which has (z) sub-polygons,
the sub-polygones are in (p) with the color (f)
Declaration:
PROCEDURE multipolygon(var p;z:word;f:longint);
Structure of (p):
p1,X1,Y1,X2,Y2,...,Xp1,Yp1, p2,X1,Y1,X2,Y2,...,Xp2,Yp2,....
pz,X1,Y1,X2,Y2,...,Xpz,Ypz (all variables are longint)
z ......................... number of sub-polygones
p1,p2,...pz ............... number of points of the sub-polygones
X1,Y1,X2,Y2,...,Xpn,Ypn ... points of the sub-polygones
triangle_flat (Unit GX3D)
=========================
Draws a single-color triangle
Declaration:
PROCEDURE triangle_flat(rend:prender);
See also:
TRender
triangle_gouraud
triangle_textured
triangle_gouraud (Unit GX3D)
============================
Draws a gouraud-color triangle
Declaration:
PROCEDURE triangle_gouraud(rend:prender);
See also:
TRender
triangle_flat
triangle_textured
triangle_textured (Unit GX3D)
=============================
Draws a textured triangle
Declaration:
PROCEDURE triangle_textured(rend:prender);
See also:
TRender
triangle_flat
triangle_gouraud
TPoint2D (Unit GX3DTYPE)
========================
Declaration:
TYPE
TPoint2D=RECORD
x,y:longint;
END;
TPoint3D (Unit GX3DTYPE)
========================
Declaration:
TYPE
TPoint3D=RECORD
x,y,z:longint;
END;
TRender (Unit GX3DTYPE)
=======================
Data-Structure used with the triangle functions
Declaration:
TYPE
PRender=^TRender;
TRender=RECORD
points:array[0..2] of TPoint3D;
colors:array[0..2] of longint;
texture:word;
texturesize:word;
texcoords:array[0..2] of TPoint2D;
rendertype:word;
END;
TRender.points
triangle coords (currently only x and y are used)
TRender.colors
colors for the points of the triangle (i.e. for gouraud shading)
TRender.texture
selector of texture
TRender.texturesize
binary logarithm of texture-size (the image must be 2^n in size, i.e. 128x128)
TRender.texcoords
coords for the three triangle-points within the texture
if the points are greater than the texture then the texture coords wrap around
See also:
TPoint2D
TPoint3D
triangle_flat
triangle_gouraud
triangle_textured
LoadImageStream (Unit GXIMG)
LoadImageFile (Unit GXIMG)
============================
Allocates memory and loads image number (nr) or the first (nr=0) image
which has the format (imagetype) from a file (filename)
or a stream (stream) into the buffer (img)
Returns 0 if loading was successful else -1
Supported formats:
BMP - 1bit, 4bit, 8bit, 24bit - uncompressed, RLE4, RLE8
GIF - 4bit, 8bit - interaced and non-interlaced - LZW-compressed
CUR - 1bit, 4bit, 8bit, 24bit - all sizes - uncompressed, RLE4, RLE8
ICO - 1bit, 4bit, 8bit, 24bit - all sizes - uncompressed, RLE4, RLE8
JPG - grayscale, RGB - standard/extended/progressive huffmann encoded (SOF0/SOF1/SOF2)
PCX - 1bit, 4bit, 8bit, 8bit grayscale, 24bit - RLE-compressed
PNG - all types - Huffman-compressed
PxM - PBM/PGM/PPM - monochrome/grayscale/RGB - ASCII & binary
TGA - 8bit, 16bit, 24bit, 32bit - uncompressed/RLE
TIF - bilevel, indexed, RGB, CMYK - uncompressed/RLE/LZW
Declaration:
TYPE TImageType=(itdetect,itBMP,itGIF,itCUR,itICO,
itJPG,itPCX,itPNG,itPxM,itTGA,itTIF);
FUNCTION LoadImageStream(imagetype:TImagetype;stream:pstream;
var img:pimage;nr:longint):longint;
FUNCTION LoadImageFile(imagetype:TImagetype;filename:string;
var img:pimage;nr:longint):longint;
WhatIsImageStream (Unit GXIMG)
WhatIsImageFile (Unit GXIMG)
============================
Returns the TImageType of a Stream or File
Declaration:
TYPE TImageType=(itdetect,itBMP,itGIF,itCUR,itICO,
itJPG,itPCX,itPNG,itPxM,itTGA,itTIF);
FUNCTION WhatIsImageStream(stream:pstream):TImagetype;
FUNCTION WhatIsImageFile(filename:string):TImagetype;
saveimageBMP (Unit GXIMG)
=========================
saves image (img) to file (filename) as a BMP file
Returns TRUE if saving was successful else FALSE
Supported formats:
24bit uncompressed
Declaration:
FUNCTION saveimageBMP(filename:string;img:pimage):boolean;
See also:
saveimagePPM
saveimageTGA
saveimagePPM (Unit GXIMG)
=========================
saves image (img) to file (filename) as a ASCII-PPM file
Returns TRUE if saving was successful else FALSE
Supported formats:
ASCII, RGB
Declaration:
FUNCTION saveimagePPM(filename:string;img:pimage):boolean;
See also:
saveimageBMP
saveimageTGA
saveimageTGA (Unit GXIMG)
=========================
saves image (img) to file (filename) as a TGA file
Returns TRUE if saving was successful else FALSE
Supported formats:
24bit, uncompressed
Declaration:
FUNCTION saveimageTGA(filename:string;img:pimage):boolean;
See also:
saveimageBMP
saveimagePPM
createimage (Unit GRAPHIX)
==========================
Creates an empty images with the
width (|x2-x1|+1) and the height (|y2-y1|+1)
Declaration:
FUNCTION createimage(x1,y1,x2,y2:longint):pimage;
See also:
createimageWH
Destroyimage
Destroyimage (Unit GRAPHIX)
==========================
Releases memory which was allocated by
loadimage, createimage, createimageWH and cloneimage
Declaration:
PROCEDURE Destroyimage(var img:pimage);
See also:
createimage
createimageWH
cloneimage
cloneimage (Unit GRAPHIX)
=========================
creates an exact copy of the image (img)
Declaration:
FUNCTION cloneimage(img:pimage):pimage;
See also:
createimage
Destroyimage
copyimage
getimagewidth (Unit GRAPHIX)
============================
returns the width of an image (img) in pixels
Declaration:
FUNCTION getimagewidth(img:pimage):longint;
See also:
getimageheight
getimageheight (Unit GRAPHIX)
=============================
returns the height of an image (img) in pixels
Declaration:
FUNCTION getimageheight(img:pimage):longint;
See also:
getimagewidth
copyimage (Unit GRAPHIX)
========================
copies an image from (src) to (dst)
(src) and (dst) must have the same size
returns (dst) if images have the same size else (nil)
the images are copied only if the images have the same size
Declaration:
FUNCTION copyimage(dst,src:pimage):pimage;
See also
cloneimage
createimageWH (Unit GRAPHIX)
============================
Creates an empty images with the
width (width) and the height (height)
and returns a pointer to the image
Declaration:
FUNCTION createimage(width,height:longint):pimage;
See also:
createimage
Destroyimage
setimageflags (Unit GRAPHIX)
============================
ORs the flags of the image (img) with (flags)
possible flags:
img_allflags = $FFFFFFFF;
img_transparency = $00000010;
img_origincoords = $00000100;
Declaration:
PROCEDURE setimageflags(img:pimage;flags:longint);
See also:
clearimageflags
getimageflags
setimagetransparencycolor
getimagetransparencycolor
clearimageflags (Unit GRAPHIX)
==============================
ANDs the flags of the image (img) with the inverted (flags)
possible flags:
img_allflags = $FFFFFFFF;
img_transparency = $00000010;
img_origincoords = $00000100;
Declaration:
PROCEDURE clearimageflags(img:pimage;flags:longint);
See also:
setimageflags
getimageflags
setimagetransparencycolor
getimagetransparencycolor
getimageflags (Unit GRAPHIX)
============================
returns the flags of the image (img) ANDed with (flags)
possible flags:
img_allflags = $FFFFFFFF;
img_transparency = $00000010;
Declaration:
FUNCTION getimageflags(img:pimage;flags:longint):longint;
See also:
setimageflags
clearimageflags
setimagetransparencycolor
getimagetransparencycolor
setimagetransparencycolor (Unit GRAPHIX)
========================================
sets the transparency-color of the image (img) to (color)
Declaration:
PROCEDURE setimagetransparencycolor(img:pimage;color:longint);
See also:
setimageflags
clearimageflags
getimageflags
getimagetransparencycolor
getimagetransparencycolor (Unit GRAPHIX)
========================================
returns the transparency-color of the image (img)
Declaration:
FUNCTION getimagetransparencycolor(img:pimage):longint;
See also:
setimageflags
clearimageflags
getimageflags
setimagetransparencycolor
TImage (Unit GXTYPES)
=====================
the image structure used by image
loaders and image management routines
Format of the image data block
width ............... width in pixels
height .............. height in pixels
bytesperline ........ bytes per line (8 byte - aligned)
bytesperpixel ....... bytes per pixel - not used
size ................ size of block at pixeldata in bytes
pixeldata ........... image data buffer
flags ............... flags
bit 4 = transparency
transparencycolor ... transparency color
originX ............. origin X coordinate relative to the drawing point reserved
originY ............. origin Y coordinate relative to the drawing point reserved
Declaration:
TYPE PImage=^TImage;
TImage=RECORD
width:longint;
height:longint;
bytesperline:longint;
bytesperpixel:longint;
size:dword;
pixeldata:pointer;
flags:dword;
transparencycolor:dword;
originX:longint;
originY:longint;
res28h:longint;
res2Ch:longint;
res30h:longint;
res34h:longint;
res38h:longint;
res3Ch:longint;
END;
TPattern (Unit GXTYPES)
=======================
the pattern structure used pattern drawing routines
Declaration:
TYPE PPattern=^TPattern;
TPattern=array[0..7] of byte;
See also:
setfillpattern
createpattern
END;
setprogressmonitor (Unit GXIMG)
===============================
sets a user-progress-indicator
this progress-monitor will be displayed by the
loadimage procedure every image line to show
the image loading progress
Declaration:
PROCEDURE SetProgressMonitor(pm:Tprogressmonitorproc);
See also:
clearprogressmonitor
Example:
PROCEDURE ProgressMonitor(curline,maxline:longint);
CONST len=100;
VAR s:string;
n,n1,n2:longint;
BEGIN
IF (maxline<=0) THEN exit;
n1:=(curline*len) DIV maxline;
s:='';
bar(10,10,10+n1,20,rgbcolor32($FFFFFF));
bar(10+n1+1,10,10+len,20,rgbcolor32($0000FF));
END;
BEGIN
...
SetProgressMonitor(@ProgressMonitor);
LoadImage(...);
...
END;
clearprogressmonitor (Unit GXIMG)
=================================
clears the user-progress-indicator
Declaration:
PROCEDURE ClearProgressMonitor;
See also:
setprogressmonitor
InitMouse (Unit GXMOUSE)
========================
Initialises Mouse (AX=0000h, INT 33h)
Call it at program startup before
you are using any other mouse calls
Declaration:
PROCEDURE InitMouse;
See also:
ReInitMouse
ReInitMouse (Unit GXMOUSE)
==========================
Reinitalises Mouse after mode switch
Call it at after using SetModeGraphiX
Declaration:
PROCEDURE ReInitMouse;
See also:
InitMouse
EnableMouse (Unit GXMOUSE)
==========================
Enables the mouse-pointer output
Declaration:
PROCEDURE EnableMouse;
See also:
DisableMouse
MouseOn
MouseOff
DisableMouse (Unit GXMOUSE)
===========================
Disables the mouse-pointer output
If the mouse is disabled through that call
the calls MouseOn and MouseOff have no effec
Declaration:
PROCEDURE DisableMouse;
See also:
EnableMouse
MouseOn
MouseOff
CreateMousePointer (Unit GXMOUSE)
=================================
Creates a user mouse pointer using an image
with the hot-spot at (x,y) or the hot-spots stored in (img)
(f) is the transparent color
(MousePointer) is initialised by that call
The user must only define the variable
Declaration:
PROCEDURE CreateMousePointer(var MousePointer:PMousePointer;img:pimage);
PROCEDURE CreateMousePointer(var MousePointer:PMousePointer;x,y:longint;img:pimage);
See also:
DestroyMousePointer
InitMousePointer
DestroyMousePointer (Unit GXMOUSE)
=================================
Deletes a mouse pointer created with CreateMousePointer
The image is NOT deleted
Declaration:
PROCEDURE DestroyMousePointer(var MousePointer:PMousePointer);
See also:
CreateMousePointer
InitMousePointer
InitMousePointer (Unit GXMOUSE)
===============================
Activates a mouse pointer which was created with CreateMousePointer
Declaration:
PROCEDURE InitMousePointer(MousePointer:PMousePointer);
See also:
CreateMousePointer
DestroyMousePointer
MouseOn (Unit GXMOUSE)
======================
shows the mouse pointer
If the mouse is disabled through DisableMouse
this call has no effect
Declaration:
PROCEDURE MouseOn;
See also:
EnableMouse
DisableMouse
MouseOff
MouseOff (Unit GXMOUSE)
=======================
hides the mouse pointer
If the mouse is disabled through DisableMouse
this call has no effect
Declaration:
PROCEDURE MouseOff;
See also:
EnableMouse
DisableMouse
MouseOn
MouseCoords (Unit GXMOUSE)
==========================
returns the current mouse coordinates (AX=0003h, INT 33h)
Declaration:
PROCEDURE MouseCoords(var x,y:longint);
See also:
MouseButton
SetMousePosition
MouseButton (Unit GXMOUSE)
==========================
returns the current mouse button status (AX=0003h, INT 33h)
Declaration:
FUNCTION MouseButton:byte;
See also:
MouseCoords
IsMouseInArea
SetMousePosition (Unit GXMOUSE)
===============================
sets the mouse pointer to (x,y) (AX=0004h, INT 33h)
Declaration:
PROCEDURE SetMousePosition(x,y:word);
See also:
MouseCoords
SetMouseArea (Unit GXMOUSE)
===========================
sets the mouse area to upper-left (x1,y1) to (x2,y2) bottom-right
(AX=0007h, INT 33h) and (AX=0008h, INT 33h)
Declaration:
PROCEDURE SetMouseArea(x1,y1,x2,y2:integer);
IsMouseInArea (Unit GXMOUSE)
============================
returns ....
(0)
if mouse IS NOT in the area (x1,y1) upper-left to (x2,y2) bottom-right
(128)
if mouse IS in the area (x1,y1) upper-left to (x2,y2) bottom-right
(128 + MouseButton)
if the mouse is in that area and a button is pressed
Declaration:
FUNCTION IsMouseInArea(x1,y1,x2,y2:longint):byte;
See also:
MouseCoords
WaitButtonReleased (Unit GXMOUSE)
=================================
waits until no button is pressed
Declaration:
PROCEDURE WaitButtonReleased;
See also:
WaitButtonPressed
WaitButtonPressed (Unit GXMOUSE)
================================
waits until a button is pressed
Declaration:
PROCEDURE WaitButtonPressed;
See also:
WaitButtonReleased
SetMousePointer (Unit GXMOUSE)
==============================
ResetMousePointer (Unit GXMOUSE)
================================
SetDrawMouseCursorProc (Unit GXMOUSE)
=====================================
ResetDrawMouseCursorProc (Unit GXMOUSE)
=======================================
TMousePointer (Unit GXMOUSE)
============================
Declaration:
TYPE PMousePointer=^TMousePointer;
TMousePointer=RECORD
x,y:integer;
f:longint;
zeiger,hg:word;
END;
See also:
CreateMousePointer
DestroyMousePointer
InitMousePointer
DefaultMousePointer
DefaultMousePointer (Unit GXMOUSE)
==================================
It is the default mouse pointer created by the calls
InitMouse and ReInitMouse
If you want to set it manually just call
InitMousePointer(DefaultMousePointer);
Declaration:
VAR DefaultMousePointer:PMousePointer;
See also:
CreateMousePointer
DestroyMousePointer
InitMousePointer
TMousePointer
Tmedia.OpenMedia (Unit GXMEDIA)
===============================
Opens the file (name) and intialises the player
Declaration:
CONSTRUCTOR Tmedia.OpenMedia(name:string);
See also:
Tmedia
Tmedia.CloseMedia
Tmedia.StartMedia (Unit GXMEDIA)
================================
Sets the frame-pointer to the first frame
Declaration:
PROCEDURE Tmedia.StartMedia;
See also:
Tmedia
Tmedia.SeekMedia
Tmedia.SeekMedia (Unit GXMEDIA)
===============================
Sets the frame-pointer to frame no. (pos)
Declaration:
PROCEDURE Tmedia.SeekMedia(pos:word);
See also:
Tmedia
Tmedia.StartMedia
Tmedia.GrabFrame (Unit GXMEDIA)
===============================
reads the a frame from the file and increases the frame-pointer
returns the pointer of the image
Declaration:
FUNCTION Tmedia.GrabFrame:pimage;virtual;
See also:
Tmedia
Tmedia.GetFrameTime (Unit GXMEDIA)
==================================
returns the frame-display-time in milliseconds
Declaration:
FUNCTION Tmedia.GetFrameTime:word;
See also:
Tmedia
Tmedia.GetNumFrame (Unit GXMEDIA)
=================================
returns the number of frames
Declaration:
FUNCTION Tmedia.GetNumFrame:word;
See also:
Tmedia
Tmedia.GetCurFrame (Unit GXMEDIA)
=================================
returns the current frame-pointer position
Declaration:
FUNCTION Tmedia.GetCurFrame:word;
See also:
Tmedia
Tmedia.GetDuration (Unit GXMEDIA)
=================================
returns the duration of the media in milliseconds
Declaration:
FUNCTION Tmedia.GetDuration:longint;
See also:
Tmedia
Tmedia.GetWidth (Unit GXMEDIA)
==============================
returns the width of the media in pixels
Declaration:
FUNCTION Tmedia.GetWidth:word;
See also:
Tmedia
Tmedia.GetHeight (Unit GXMEDIA)
===============================
returns the height of the media in pixels
Declaration:
FUNCTION Tmedia.GetHeight:word;
See also:
Tmedia
Tmedia.EndofMedia (Unit GXMEDIA)
================================
returns TRUE if the last frame was read from the file
or if OpenMedia failed else FALSE
Declaration:
FUNCTION Tmedia.EndofMedia:boolean;
See also:
Tmedia
Tmedia.CloseMedia (Unit GXMEDIA)
================================
Closes the media file and releases memory
Declaration:
DESTRUCTOR Tmedia.CloseMedia;virtual;
See also:
Tmedia
Tmedia.OpenMedia
Tmedia.SetRenderMode (Unit GXMEDIA)
===================================
Sets the frame render mode
There are currently two constants defined
CONST gmrm_solid =$00000000;
gmrm_transparency =$00000001;
gmrm_solid .......... generates solid frames
gmrm_transperency ... generates transparent frames which must be
displayed with the xxximageC functions
Limitations:
- This procedure has only an effect for TMediaGIF
- This procedure should be called directly after OpenMedia
Declaration:
DESTRUCTOR Tmedia.SetRenderMode(mode:longint);virtual;
See also:
Tmedia
TmediaGIF
Tmedia (Unit GXMEDIA)
=====================
Tmedia is the base object - it does nothing
This are the objects:
TmediaANI - Animated Cursor
TmediaAVI - Audio Video Interleave
TmediaGIF - GIF-Animations
TmediaFLC - Autodesk (tm) Animations
TmediaMOV - Quicktime (tm) Movies
Declaration:
PMedia=^TMedia;
TMedia=OBJECT
MediaF:file;
success:boolean;
numframe,curframe:word;
framexd,frameyd:word;
framebuf:pimage;
frametime:longint;
timeofmedia:longint;
frameidxlist:pointer;
flags:longint;
processbuf:pointer;
CONSTRUCTOR OpenMedia(name:string);
PROCEDURE StartMedia;
PROCEDURE SeekMedia(pos:word);
FUNCTION GrabFrame:pimage;virtual;
FUNCTION GetFrameTime:word;
FUNCTION GetNumFrame:word;
FUNCTION GetCurFrame:word;
FUNCTION GetDuration:longint;
FUNCTION GetWidth:word;
FUNCTION GetHeight:word;
FUNCTION EndofMedia:boolean;
DESTRUCTOR CloseMedia;virtual;
END;
TmediaAVI (Unit GXMEDIA)
========================
The AVI-Player Object
Supported Codecs:
Uncompressed Bitmap - 8,16,24,32bit
Microsoft Video 1 - 8,16bit
Microsoft RLE - 8bit
Radius Cinepak - 24bit
Declaration:
PmediaAVI=^TMediaAVI;
TmediaAVI=OBJECT(Tmedia)
Example:
USES crt,graphix,gxmedia;
VAR myplayer:PmediaAVI;
BEGIN
new(myplayer,OpenMedia('MYVIDEO.AVI'));
WHILE NOT myplayer^.EndofMedia DO
BEGIN
putimage(0,0,myplayer^.grabframe);
delay(myplayer^.GetFrameTime);
END;
dispose(myplayer,CloseMedia);
END.
TmediaFLC (Unit GXMEDIA)
========================
The FLC-Player Object
Supported Formats:
FLI - 8bit
FLC - 8bit
Declaration:
PmediaFLC=^TMediaFLC;
TmediaFLC=OBJECT(Tmedia)
Example:
USES crt,graphix,gxmedia;
VAR myplayer:PmediaFLC;
BEGIN
new(myplayer,OpenMedia('MYANIM.FLC'));
WHILE NOT myplayer^.EndofMedia DO
BEGIN
putimage(0,0,myplayer^.grabframe);
delay(myplayer^.GetFrameTime);
END;
dispose(myplayer,CloseMedia);
END.
TmediaGIF (Unit GXMEDIA)
========================
The GIF-Animator
It handles also simple GIF-Files
Supported formats:
GIF87a and GIF89a
single and multiple image
4 and 8bit, interlaced & non-interlaced
Declaration:
PmediaGIF=^TMediaGIF;
TmediaGIF=OBJECT(Tmedia)
Example for solid animations:
USES crt,graphix,gxmedia;
VAR myplayer:PmediaGIF;
BEGIN
InitGraphiX(ig_vesa,ig_lfb);
SetModeGraphiX(640,480,ig_col16);
new(myplayer,OpenMedia('MYANIM.GIF'));
WHILE NOT myplayer^.EndofMedia DO
BEGIN
putimage(0,0,myplayer^.grabframe);
delay(myplayer^.GetFrameTime);
END;
dispose(myplayer,CloseMedia);
END.
Example for transparent animations:
USES crt,graphix,gxmedia,gximeff;
VAR myplayer:PmediaGIF;
backgroundimage,tempimage:pimage;
BEGIN
InitGraphiX(ig_vesa,ig_lfb);
SetModeGraphiX(640,480,ig_col16);
x:=0; { screen position of frame }
y:=0;
new(myplayer,OpenMedia('MYANIM.GIF'));
myplayer^.SetRenderMode(gmrm_transparency);
backgroundimage:=createimage(myplayer^.getwidth,mediaplayer^.getheight);
tempimage:=createimage(myplayer^.getwidth,mediaplayer^.getheight);
getimage(x,y,backgroundimage); { save background }
WHILE NOT myplayer^.EndofMedia DO
BEGIN
copyimage(tempimage,backgroundimage); { copy background to temp-image }
composeimageC(tempimage,myplayer^.grabframe,0,0); { put 'mplayer^.getframe' on temp-image }
putimage(0,0,tempimage);
delay(myplayer^.GetFrameTime);
END;
Destroyimage(backgroundimage);
Destroyimage(tempimage);
dispose(myplayer,CloseMedia);
END.
TmediaMOV (Unit GXMEDIA)
========================
The Quicktime (tm) - Movie Player
Supported Codecs:
Apple Animation - 8,16,24bit
Radius Cinepak - 24bit
Declaration:
PmediaMOV=^TMediaMOV;
TmediaMOV=OBJECT(Tmedia)
Example:
USES crt,graphix,gxmedia;
VAR myplayer:PmediaMOV;
BEGIN
new(myplayer,OpenMedia('MYVIDEO.MOV'));
WHILE NOT myplayer^.EndofMedia DO
BEGIN
putimage(0,0,myplayer^.grabframe);
delay(myplayer^.GetFrameTime);
END;
dispose(myplayer,CloseMedia);
END.
TmediaANI (Unit GXMEDIA)
========================
The Animated Cursor Object
Declaration:
PmediaANI=^TMediaANI;
TmediaANI=OBJECT(Tmedia)
TFont.LoadFont (Unit GXTEXT)
============================
Loads the font (name)
TFontVGA does not need any font files
Declaration:
CONSTRUCTOR TFontVGA.LoadFont;
CONSTRUCTOR TFontCHR.LoadFont(name:string);
CONSTRUCTOR TFontFNT.LoadFont(name:string);
CONSTRUCTOR TFontTTF.LoadFont(name:string);
See also:
TFont.RemoveFont
TFont.outtext (Unit GXTEXT)
TFontTTF.outunicode (Unit GXTEXT)
=================================
draws the text (s) at (x,y) with the color (f)
draws the unicode (uc) with the length (len) at (x,y) with the color (col)
if (len) = -1 then the unicode string is handled as a 0-terminated string
Declaration:
PROCEDURE TFont.outtext(x,y:longint;s:string;f:longint);
PROCEDURE TFontTTF.outunicode(x,y:longint;uc:PUnicode;len,col:longint);
TFont.setfontdirection (Unit GXTEXT)
====================================
sets the direction
0 .. 65536 = 0ø .. 360ø
0 - 0ø ... horizontal right
16383 - 90ø ... vertical down
32767 - 180ø ... horizontal left (upside down)
49151 - 270ø ... vertical up
Declaration:
PROCEDURE Tfont.setfontdirection(dir:word);
TFont.setfontstyle (Unit GXTEXT)
================================
style:
ft_normal ... normal - font
ft_italic ... italic - font
Declaration:
PROCEDURE Tfont.setfontstyle(size:longint);
TFont.setfontsize (Unit GXTEXT)
===============================
sets the size... (fontheight in pixel)
(size) a number >=1
usefull numbers are 5 < x < 100
Declaration:
PROCEDURE Tfont.setfontstyle(style:longint);
TFont.textlength (Unit GXTEXT)
TFontTTF.unicodelength (Unit GXTTF)
===================================
returns the length of the string (s) or unicode string (uc)
Declaration:
FUNCTION TFont.textlength(s:string):longint;virtual;
FUNCTION TFontTTF.unicodelength(uc:PUnicode;len:longint):longint;
See also:
TFont.textheight
TFont.fontheight
TFont.textheight (Unit GXTEXT)
TFontTTF.unicodeheight (Unit GXTEXT)
====================================
returns the height of the string (s)
CURRENTLY it returns the same as TFont.fontheight
Declaration:
FUNCTION TFont.textheight(s:string):longint;virtual;
FUNCTION TFontTTF.unicodeheight(uc:PUnicode;len:longint):longint;
See also:
TFont.textlength
TFont.fontheight
TFont.fontheight (Unit GXTEXT)
==============================
returns the height of the font
CURRENTLY it returns the same as TFont.textheight
Declaration:
FUNCTION TFont.fontheight:integer;virtual;
See also:
TFont.textlength
TFont.textheight
TFont.RemoveFont (Unit GXTEXT)
==============================
releases memory which was allocated by TFont.LoadFont
Declaration:
DESTRUCTOR TFont.RemoveFont;
TFont.setimage (Unit GXTEXT)
============================
sets the text output to (image)
if image is 'nil' then the output is set
to the screen
Declaration:
PROCEDURE setimage(image:pimage);
EditText (Unit GXTEXT)
======================
A simple Single-Line-Text-Editor
Declaration:
FUNCTION EditText(Font:PFont;x,y,d,fg,bg:longint;var txt:string;max:byte):boolean;
uses font (Font) and sets the editor-field to (x,y)
with the length (l) and text color (fg) and background color (bg)
the string (s) is displayed and can be edited
the max string length is (max)
it returns TRUE if the last key was ENTER - (s) is changed
else FALSE if the last key was ESC - (s) is left unchanged
TFont (Unit GXTEXT)
===================
The font-object - it does nothing
Declaration:
TYPE PFont=^TFont;
TFont=OBJECT
fontptr:pointer;
fontsize:longint;
CONSTRUCTOR LoadFont;
PROCEDURE outtext(x,y:integer;s:string;f:longint);virtual;
FUNCTION textlength(s:string):integer;virtual;
FUNCTION textheight(s:string):integer;virtual;
FUNCTION fontheight:integer;virtual;
DESTRUCTOR RemoveFont;
END;
TFontVGA (Unit GXTEXT)
======================
The VGA-BIOS font Object
Requires VGA-BIOS-INT 10h function AX=1130h
Declaration:
TYPE PFontVGA=^TFontVGA;
TFontVGA=OBJECT(TFont)
TFontCHR (Unit GXTEXT)
======================
The Borland (tm) BGI-Font Object
Declaration:
TYPE PFontCHR=^TFontCHR;
TFontCHR=OBJECT(TFont)
TFontFNT (Unit GXTEXT)
======================
The MS Windows (tm) Bitmap-Font Object
Declaration:
TYPE PFontFNT=^TFontFNT;
TFontFNT=OBJECT(TFont)
TFontTTF (Unit GXTTF)
======================
The Truetype-Font Object
Declaration:
TYPE PFontTTF=^TFontTTF;
TFontTTF=OBJECT(TFont)
blendimageALPHA (Unit GXIMEFF)
==============================
all images (dst) and (src) MUST have the same size
no check is done
returns (dst) after processing the images
(alpha) MUST be a value within the 0..255 range
Declaration:
FUNCTION blendimageALPHA(dst,src:pimage;alpha:longint):pimage;
Formula:
[dst] = [src] * alpha
blendimageALPHAcolor (Unit GXIMEFF)
===================================
all images (dst) and (src) MUST have the same size
no check is done
returns (dst) after processing the images
(alpha) MUST be a value within the 0..255 range
Declaration:
FUNCTION blendimageALPHAcolor(dst,src:pimage;alpha:longint;color:longint):pimage;
Formula:
[dst] = color + ( [src] - color ) * alpha
blendimageALPHAimage (Unit GXIMEFF)
===================================
all images (dst), (src) and (image) MUST have the same size
no check is done
returns (dst) after processing the images
(alpha) MUST be a value within the 0..255 range
Declaration:
FUNCTION blendimageALPHAimage(dst,src:pimage;alpha:longint;image:pimage):pimage;
Formula:
[dst] = color + ( [src] - [image] ) * alpha
blendimageMASK (Unit GXIMEFF)
=============================
all images (dst), (src) and (mask) MUST have the same size
no check is done
returns (dst) after processing the images
Declaration:
FUNCTION blendimageMASK(dst,src,mask:pimage):pimage;
Formula:
[dst] = [src] * [mask]
blendimageMASKcolor (Unit GXIMEFF)
==================================
all images (dst), (src) and (mask) MUST have the same size
no check is done
returns (dst) after processing the images
Declaration:
FUNCTION blendimageMASKcolor(dst,src,mask:pimage;color:longint):pimage;
Formula:
[dst] = color + ( [src] - color ) * [mask]
blendimageMASKimage (Unit GXIMEFF)
==================================
all images (dst), (src), (mask) and (image)
MUST have the same size
no check is done
returns (dst) after processing the images
Declaration:
FUNCTION blendimageMASKimage(dst,src,mask:pimage;image:pimage):pimage;
Formula:
[dst] = [image] + ( [src] - [image] ) * [mask]
imageADDcolor (Unit GXIMEFF)
imageSUBcolor (Unit GXIMEFF)
imageSADDcolor (Unit GXIMEFF)
imageSSUBcolor (Unit GXIMEFF)
imageANDcolor (Unit GXIMEFF)
imageORcolor (Unit GXIMEFF)
imageXORcolor (Unit GXIMEFF)
============================
all images (dst) and (src) MUST have the same size
no check is done
returns (dst) after processing the images
Declaration:
FUNCTION imageXXXcolor(dst,src:pimage;color:longint):pimage;
ADD .... packed addition
SUB .... packed subtraction
SADD ... saturated addition
SSUB ... saturated subtraction
AND .... bitwise AND
OR ..... bitwise OR
XOR .... bitwise XOR
Formula:
[dst] = [src1] # [src2] # = ADD/SUB/SADD/SSUB/AND/OR/XOR
imageADDimage (Unit GXIMEFF)
imageSUBimage (Unit GXIMEFF)
imageSADDimage (Unit GXIMEFF)
imageSSUBimage (Unit GXIMEFF)
imageANDimage (Unit GXIMEFF)
imageORimage (Unit GXIMEFF)
imageXORimage (Unit GXIMEFF)
============================
all images (dst), (src1) and (src2) MUST have the same size
no check is done
returns (dst) after processing the images
Declaration:
FUNCTION imageXXXimage(dst,src1,src2:pimage):pimage;
ADD .... packed addition
SUB .... packed subtraction
SADD ... saturated addition
SSUB ... saturated subtraction
AND .... bitwise AND
OR ..... bitwise OR
XOR .... bitwise XOR
Formula:
[dst] = [src1] # [src2] # = ADD/SUB/SADD/SSUB/AND/OR/XOR
fillimage (Unit GXIMEFF)
========================
fills image (dst) with color (color)
returns (dst) after processing the images
Declaration:
FUNCTION fillimage(dst:pimage;color:longint):pimage;
flipimageH (Unit GXIMEFF)
flipimageV (Unit GXIMEFF)
=========================
flipimageH flips the image (src) horizontally and stores the
result in (dst)
flipimageV flips the image (src) vertically and stores the
result in (dst)
all images (dst) and (src) MUST have the same size
returns (dst) after processing the images
Declaration:
FUNCTION flipimageH(dst,src:pimage):pimage;
FUNCTION flipimageV(dst,src:pimage):pimage;
scaleimage (Unit GXIMEFF)
=========================
scales image (src) up or down to the size of (dst)
result is stored in (dst)
returns (dst) after processing the images
Declaration:
FUNCTION scaleimage(dst,src:pimage):pimage;
rotateimage (Unit GXIMEFF)
==========================
rotates an image (src) into (dst) with the angle (w)
(w) = 0..65536 <=> 0..360ø
(rx,ry) is the rotation point of (dst)
(fy,fy) is the rotation point of (src)
(xd,yd) is the width/height of the rotated image
returns (dst) after processing the images
Declaration:
FUNCTION rotateimage(dst,src:pimage;rx,ry,fx,fy,xd,yd,w:longint):pimage;
composeimage (Unit GXIMEFF)
===========================
puts the image (image) into the 'screen' (dst) at position (x,y)
image is clipped at the borders
returns (dst) after processing the images
Declaration:
FUNCTION composeimage(dst,image:pimage;x,y:longint):pimage;
composeimageC (Unit GXIMEFF)
============================
puts the image (image) into the 'screen' (dst) at position (x,y)
using a transparency color (color)
image is clipped at the borders
returns (dst) after processing the images
Declaration:
FUNCTION composeimageC(dst,image:pimage;x,y,color:longint):pimage;
mosaicimage (Unit GXIMEFF)
==========================
'mosaic-effect' from (src) into (dst)
(xc,yc) is the 'fixed point'
(fx,fy) is the width/height of the mosaic-blocks
returns (dst) after processing the images
Declaration:
FUNCTION mosaicimage(dst,src:pimage;xc,yc,fx,fy:longint):pimage;
averageimage (Unit GXIMEFF)
===========================
'averaging-filter' from (src) into (dst)
(xc,yc) is center-point of the square (fx,fy)
(fx,fy) is the width/height of the averaging-blocks
returns (dst) after processing the images
Declaration:
FUNCTION averageimage(dst,src:pimage;xc,yc,fx,fy:longint):pimage;
filterimage (Unit GXIMEFF)
==========================
'averaging-filter' from (src) into (dst)
(filter) is a 2D-packed-byte-array
==> VAR filter:array[1..(fx),1..(fy)] of byte; {$PackRecords 1}
(xc,yc) is center-point of the filter (fx,fy)
(fx,fy) is the width/height of the filter
returns (dst) after processing the images
Declaration:
FUNCTION filterimage(dst,src:pimage;var filter;xc,yc,fx,fy:longint):pimage;
Example:
CONST blur_filter:array[1..3,1..3] of byte=
((0,1,0),
(1,4,1),
(0,1,0)); {center is (1,1)}
filterimage(dst,src,blur_filter,1,1,3,3);
UserDataToImageRGB (Unit GXIMEFF)
=================================
converts user-rgb-data in (src) to an image (dst)
(bpp) is bytes per pixel of the user-rgb-data
(Rpos,Gpos,Bpos) are the positions of the RGB channels of the user-rgb-data
(Rsiz,Gsiz,Bsiz) are the sizes of the RGB channels of the user-rgb-data
returns (dst) after processing the images
Declaration:
FUNCTION userdatatoimagergb(dst:pimage;src:pointer;bpp:longint;Rpos,Rsiz,Gpos,Gsiz,Bpos,Bsiz:byte):pimage;
UserDataToImagePAL (Unit GXIMEFF)
=================================
converts user-palettized-data in (src) to an image (dst)
(bpp) is bytes per pixel of the user-pal-data
(idxbits) is the width of the indexes of the user-pal-data
(palette) is an array[1..(1 SHL idxbits)] of longint;
the palette-entries have the same color-format as the current graphics mode
returns (dst) after processing the images
Declaration:
FUNCTION userdatatoimagepal(dst:pimage;src:pointer;bpp,idxbits:longint;var palette):pimage;
imageputpixel (Unit GXDRW)
==========================
imagegetpixel (Unit GXDRW)
==========================
imageline (Unit GXDRW)
======================
imagelineXOR (Unit GXDRW)
=========================
imagelineh (Unit GXDRW)
=======================
imagelinev (Unit GXDRW)
=======================
imagerectangle (Unit GXDRW)
===========================
imagebar (Unit GXDRW)
=====================
imagebarXOR (Unit GXDRW)
========================
imagemoverect (Unit GXDRW)
==========================
imagegetimage (Unit GXDRW)
==========================
imageputimage (Unit GXDRW)
==========================
imageputimageC (Unit GXDRW)
===========================
imageputimagepart (Unit GXDRW)
==============================
imageputimagepartC (Unit GXDRW)
===============================
imagezoomimage (Unit GXDRW)
===========================
imagezoomimageC (Unit GXDRW)
============================
imageputbitmap (Unit GXDRW)
===========================
Draws an monochrome bit-map (bitmap) with the
width (w) and height (h) and (bpl) bytes per line
to (x,y) with the color (col) onto image (image)
Declaration:
PROCEDURE imageputbitmap(image:pimage;x,y,w,h,bpl,col:longint;var bitmap);
END OF FILE - Created with MAKE-HTML (c) 1999 Michael Knapp