The content below is subject to my Conditions of Use!
(The link opens a new window.)
Der folgende Inhalt unterliegt meinen Nutzungsbedingungen!
(Der Link öffnet ein neues Fenster.)
If you already have the unit,
you may want to
skip down to the user´s manual.
Falls du die Unit bereits hast,
möchtest du vielleicht
direkt zum Nutzerhandbuch springen.
The FJ_VGO1.pas (Falk Joensson´s Virtual Graphic Objects) is a unit I wrote to create graphics with Delphi. Yes, I know, there are some standard graphics routines included with Delphi. But mine are far more luxurious: with antialiasing (soft shapes instead of pixel edges), color rainbows and advanced ready-to-use algorithms. Die FJ_VGO1.pas (Falk Joenssons Virtuelle graphische Objekte) ist eine Unit, die ich geschrieben habe, um Graphiken mit Delphi zu erstellen. Jaja, ich weiß, Delphi hat von Haus aus auch selber Graphikroutinen. Meine sind aber viel luxuriöser: mit Antialiasing (weiche Formen statt Pixelkanten), Farbspielen und sofort verwendbaren erweiterten Algorithmen.
First, download the packed unit, and unzip it to a directory on your harddrive, where you can easily find it. Then create a new VCL application with Delphi, and place a copy of the FJ_VGO1.pas in its directory. DOWNLOAD
FJ_VGO1.pas.zip
(8,8 KB)
Lade zuerst die gepackte Unit herunter, und entzippe sie in ein Verzeichnis auf deiner Festplatte, so daß du sie leicht wiederfindest. Dann erstelle eine neue VCL-Anwendung mit Delphi, und kopiere die FJ_VGO1.pas mit in ihr Verzeichnis.

The basic steps to use the FJ_VGO1.pas in a Delphi project are:
  1. include the unit in your project (Uses ...)
  2. put a TImage somewhere on your form (preferably visible, and it should be of a static size) — in my examples I will simply call it "pic"
  3. in your form´s OnCreate setup the pic.Picture.Bitmap:
    1. Create
    2. set Width and Height
    3. set PixelFormat to pf24bit
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes,
  Graphics, Controls, Forms, Dialogs, ExtCtrls,
  FJ_VGO1; // 1.

type
  TForm1 = class(TForm)
    pic: TImage; // (2.)
    procedure FormCreate(Sender: TObject); // (3.)
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  with pic.Picture.Bitmap do begin // 3.
    Create; // 3.1.
    Width := pic.Width; // 3.2.
    Height := pic.Height; // 3.2.
    PixelFormat := pf24bit; // 3.3.
  end;
end;

end.
Die grundlegenden Schritte, um die FJ_VGO1.pas in einem Delphi-Projekt zu nutzen, sind:
  1. binde die Unit in dein Projekt ein (Uses ...)
  2. lege ein TImage irgendwo auf dein Form (vorzugsweise sichtbar, und die Größe sollte sich nie ändern) — in meinen Beispielen werde ich es einfach "pic" nennen
  3. in dem OnCreate deines Forms initialisiere die pic.Picture.Bitmap:
    1. Create
    2. setze Width und Height
    3. setze PixelFormat auf pf24bit

We will now use the pic.OnClick to test the functions of the FJ_VGO1.pas.

As the very basic (we will discuss the types and functions used later):

  1. declare a variable of the __VGO type;
    I will call it "lVGO"
  2. setup the VGO with width and height via VGO_setupX()
  3. give the VGO a background color via VGO_clear(),
    probably using VGO_ink() for the color
  4. finally show the VGO image on the TImage via VGO_displayX()
Below you see the source code for this, and the resulting image (128x128 example):
Wir werden nun das pic.OnClick verwenden, um die Funktionen der FJ_VGO1.pas zu testen.

Die absolute Grundlage (wir werden auf die verwendeten Elemente später noch eingehen):

  1. deklariere eine Variable vom Typ __VGO;
    ich werde meine "lVGO" nennen
  2. initialisiere das VGO mit Breite und Höhe mittels VGO_setupX()
  3. gib dem VGO eine Hindergrundfarbe durch VGO_clear(),
    wobei du wahrscheinlich VGO_ink() für die Farbe nehmen wirst
  4. nun lasse das VGO-Bild auf dem TImage anzeigen mit VGO_displayX()
Unten siehst du den Sourcecode für das alles, und daneben das daraus resultierende Bild (128x128-Pixel-Beispiel):
procedure TForm1.picClick(Sender: TObject);
var
  lVGO:__VGO; // 1.
begin
  VGO_setupX(lVGO,pic.Width,pic.Height); // 2.
  VGO_clear(lVGO,VGO_ink($963f)); // 3.
  VGO_displayX(pic,lVGO); // 4.
end;

A Tiny Demo

Ein kleines Demo

After the monocolor intro a little peek ahead: Just by replacing the line 3 (VGO_clear) from the last example with four other lines, here is what FJ_VGO1.pas can do: Nach dem einfarbigen Einstieg schonmal ein kleiner Vorgriff: Einfach durch das Ersetzen der Zeile 3 (VGO_clear) aus dem letzten Beispiel durch vier andere Zeilen kann FJ_VGO1.pas folgendes:
VGO_clear4(lVGO,VGO_ink($963f),VGO_ink($396f),
                VGO_ink($639f),VGO_ink($ff0f));
VGO_grain(lVGO,$11);
VGO_drawTorus2(lVGO,64,64,32,96,
                    VGO_ink($0006),VGO_ink($fff3));
VGO_framer(lVGO,MakeRectA(15,25,80,60),9,$99,1);

User´s Manual

Nutzerhandbuch

type __VGO
type __GRBO
type __Ink
VGO_ink
type __RectA
MakeRectA
VGO_setup
VGO_setupX
VGO_clear
VGO_clear4
VGO_displayX
VGO_kill
VGO_setPixel
VGO_putPixel
VGO_drawPoint
VGO_setLine
VGO_setLineDotted
VGO_putLine
VGO_drawLine
VGO_drawLine2
VGO_drawRing
VGO_drawTorus
VGO_drawTorus2
VGO_setRect
VGO_putRect
VGO_putRect4
VGO_markupRect
VGO_setBorder
VGO_putBorder
VGO_setBorder2
VGO_putBorder2
VGO_outline
VGO_framer
VGO_framerPlus
VGO_screenCapture
VGO_simpleBlur
VGO_grain
VGO_scanlines
VGO_duplicate
VGO_setMerge
VGO_putMerge
VGO_setCopy
VGO_putCopy
VGO2BMP
BMP2VGO
VGO_setOpacity
VGO_mulOpacity
VGO_fadeOpacity
VGO_GRBO2Ink
VGO_Ink2GRBO
VGO_TColor2Ink
VGO_getPixel
VGO_getOpacity
VGO_X
VGO_S
CopyGRBO
VGO_blendInks
CopyRectA
InRectA
ModifyRectA
TrimRectAL
TrimRectAR
TrimRectAT
TrimRectAB

type __VGO

back to the index · zurück zum Index
All VGO_... procedures and functions work on a variable of this type. Think of it as a "virtual screen" or canvas, which is first drawn on until the image is done, before the result is shown on the actual physical screen (through a TImage) by calling VGO_displayX. Alle mit VGO_... beginnenden Prozeduren und Funktionen arbeiten auf einer Variable dieses Typs. Am besten stellst du dir darunter einen "virtuellen Bildschirm" oder eine Leinwand vor, auf der gemalt wird, bis das Bild fertig ist. Erst dann wird es schließlich auf dem richtigen, physischen Bildschirm angezeigt (durch ein TImage), indem man VGO_displayX ausführt.

type __GRBO

back to the index · zurück zum Index
This record is used to store an ink information, which consists of three color channels (.G, .R, .B) and one opacity channel (.O), each represented by one Byte. Dieser Record speichert eine Ink-Information ("ink" = englisch für "Tinte"), bestehend aus drei Farbkanälen (.G, .R, .B) und einem Deckkraft-Kanal (englisch: opacity) (.O). Jeder Kanal wird durch jeweils ein Byte repräsentiert.

type __Ink

back to the index · zurück zum Index
This is actually just a renamed Longword, to store an ink information (see type __GRBO) in a low-level VGO format ($OORRGGBB). Most VGO routines need colors to be given as __Ink. Dies ist im Grunde nur ein umbenanntes Longword, und dient dem Speichern einer Ink-Information (siehe type __GRBO) in einem low-level VGO-Format ($OORRGGBB). Die meisten VGO-Routinen wollen Farben als __Ink übergeben haben.

VGO_ink

back to the index · zurück zum Index
My preferred way of using colors in VGO is using the VGO_ink function, which wants a word that encodes an ink in nibbles, and returns an __Ink.
  • oGRBOnibbles:Word = the ink as $GRBO
    → examples:
    $000F is solid black
    $0008 is half-transparent black
    $0001 is very transparent black
    $0000 is useless ;)
    $F00F is full green, aka lime
    $0F0F is full red
    $00FF is full blue
    $FF0F is yellow
    $8F0F is orange
    $FFFF is white
  • result:__Ink
Farben in VGO verwende ich am liebsten mit der VGO_ink-Funktion, die ein Word mit der Ink in Nibbles codiert haben möchte, und __Ink zurückgibt.
  • oGRBOnibbles:Word = die Ink als $GRBO
    → Beispiele:
    $000F ist Pechschwarz
    $0008 ist halbtransparentes Schwarz
    $0001 ist hochtransparentes Schwarz
    $0000 ist ziemlich dusslig ;)
    $F00F ist Knallgrün
    $0F0F ist Knallrot
    $00FF ist Knallblau
    $FF0F ist Gelb
    $8F0F ist Orange
    $FFFF ist Weiß
  • result:__Ink
lInk := VGO_ink($369F); // same as lInk := $FF663399;

type __RectA

back to the index · zurück zum Index
This record stores the position (.x, .y) and size (.w, .h) of a rectangular area; all four items are Integer. The __RectA is mainly used to perform advanced operations on VGOs. Dieser Record speichert die Position (.x, .y) und Größe (.w, .h) eines rechteckigen Bereichs; alle vier Angaben sind Integer. Verwendet wird __RectA vor allem, um komplexere Operationen auf VGOs auszuführen.

MakeRectA

back to the index · zurück zum Index
Where a VGO routine wants a __RectA, you can simply input the values with the MakeRectA:
  • ox:Integer = horizontal offset of the rectangle (left side)
  • oy:Integer = vertical offset of the rectangle (top side)
  • ow:Integer = width of the rectangle
  • oh:Integer = height of the rectangle
  • result:__RectA
Wenn eine VGO-Routine ein __RectA möchte, kannst du die Werte ganz einfach mit dem MakeRectA eingeben:
  • ox:Integer = horizontaler Versatz des Rechtecks (linke Seite)
  • oy:Integer = vertikaler Versatz des Rechtecks (obere Seite)
  • ow:Integer = Breite des Rechtecks
  • oh:Integer = Höhe des Rechtecks
  • result:__RectA
lRectA := MakeRectA(10,25,70,32);
{ same as:
  lRectA.x := 10;
  lRectA.y := 25;
  lRectA.w := 70;
  lRectA.h := 32;
}

VGO_setup

back to the index · zurück zum Index
In most cases, you will initialise a __VGO using the simpler VGO_setupX, but sometimes you may want to define some special properties: the "focus offset" and/or the overall opacity. (Both are almost only used in VGO_putMerge — see there.)
  • var oVGO:__VGO = the VGO variable that you want to use
  • ow:Integer = the width of the VGO
  • oh:Integer = the height of the VGO
  • ofx:Integer = the horizontal focus offset
  • ofy:Integer = the vertical focus offset
  • oal:Byte = the "alpha", which means the overall opacity
VGO_setupX defaults ofx and ofy to 0 and oal to $FF.
In den meisten Fällen wirst du ein __VGO mit dem einfacheren VGO_setupX initialisieren, aber manchmal möchtest du vielleicht doch ein paar speziellere Eigenschaften setzen: den "Fokusversatz" und/oder die Gesamtdeckkraft. (Beide werden fast nur in VGO_putMerge verwendet — siehe dort.)
  • var oVGO:__VGO = die VGO-Variable, die du benutzen willst
  • ow:Integer = die Breite des VGOs
  • oh:Integer = die Höhe des VGOs
  • ofx:Integer = der horizontale Fokusversatz
  • ofy:Integer = der vertikale Fokusversatz
  • oal:Byte = das "Alpha", was der Gesamtdeckkraft entspricht
VGO_setupX setzt ofx und ofy auf 0 und oal auf $FF.
VGO_setup(lVGO,lW,lH,0,0,$FF); // same as VGO_setupX(lVGO,lW,lH);

VGO_setupX

back to the index · zurück zum Index
Before you can do anything with a VGO, you first need to initialise it with this procedure.
  • var oVGO:__VGO = the VGO variable that you want to use
  • ow:Integer = the width of the VGO
  • oh:Integer = the height of the VGO
Ehe du irgendwas mt einem VGO anstellen kannst, mußt du es zunächst mit dieser Prozedur initialisieren.
  • var oVGO:__VGO = die VGO-Variable, die du benutzen willst
  • ow:Integer = die Breite des VGOs
  • oh:Integer = die Höhe des VGOs
VGO_setupX(lVGO1,pic.Width,pic.Height); // fits the pic
VGO_setupX(lVGO2,160,90); // 160 by 90 pixels

VGO_clear

back to the index · zurück zum Index
This is usually the first procedure you will use after VGO_setupX. The VGO will be "cleared" with a background color; ie all pixels of the VGO will be set to this very color.
  • var oTo:__VGO = your VGO
  • oFrom:__Ink = the color you want the VGO to assume
Dies ist normalerweise die erste Prozedure, die du nach VGO_setupX einsetzen wirst. Das VGO wird mit einer Hintergrundfarbe "gelöscht"; es werden also alle Pixel des VGOs auf diese Farbe gesetzt.
  • var oTo:__VGO = dein VGO
  • oFrom:__Ink = die Farbe, die dein VGO annehmen soll
VGO_clear(lVGO,VGO_ink($963F));

VGO_clear4

back to the index · zurück zum Index
Now it gets interesting (and colorful). Instead of clearing a VGO with simply a solid background color (VGO_clear), you can define individual colors for all its corners, creating soft color sweeps with VGO_clear4.
  • var oTo:__VGO = your VGO
  • oITL:__Ink = color for the top left corner
  • oITR:__Ink = color for the top right corner
  • oIBL:__Ink = color for the bottom left corner
  • oIBR:__Ink = color for the bottom right corner
Jetzt wird es interessant (und bunt). Anstatt ein VGO mit einer schlichten Hintergrundfarbe zu versehen (VGO_clear), kannst du mit VGO_clear4 jeder Ecke eine eigene individuelle Farbe zuweisen, und weiche Farbverläufe werden dazwischen erzeugt.
  • var oTo:__VGO = dein VGO
  • oITL:__Ink = Farbe der Ecke oben links
  • oITR:__Ink = Farbe der Ecke oben rechts
  • oIBL:__Ink = Farbe der Ecke unten links
  • oIBR:__Ink = Farbe der Ecke unten rechts
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_clear4(lVGO,VGO_ink($80FF),VGO_ink($80FF),
                VGO_ink($8F0F),VGO_ink($8F0F));
VGO_clear4(lVGO,VGO_ink($000F),VGO_ink($C96F),
                VGO_ink($C96F),VGO_ink($000F));

VGO_displayX

back to the index · zurück zum Index
After you have finished your VGO artwork, you might want to see it shown on a TImage. And that´s just what VGO_displayX does.
  • var oTo:TImage = the TImage that shall display your VGO
  • oFrom:__VGO = your VGO
Nachdem du dein VGO-Kunstwerk fertiggestellt hast, möchtest du es wahrscheinlich auch auf einem TImage dargestellt haben. Und genau das tut VGO_displayX.
  • var oTo:TImage = das TImage, das dein VGO anzeigen soll
  • oFrom:__VGO = dein VGO
VGO_displayX(pic,lVGO); // show our lVGO on the TImage pic

VGO_kill

back to the index · zurück zum Index
As a tidy person, you should clean up the data space when you don´t need a VGO anymore (eg in your form´s OnDestroy).
  • var oVGO:__VGO = your VGO (say goodbye!)
Als ordnungsliebende Person solltest du den Dataspace aufräumen, wenn du ein VGO nicht mehr brauchst (etwa im OnDestroy deines Forms).
  • var oVGO:__VGO = dein VGO (sag adieu!)

VGO_setPixel

back to the index · zurück zum Index
To set a pixel of the VGO to a desired ink (replacing the old one), use VGO_setPixel.
  • var oTo:__VGO = your VGO
  • ox:Integer = the pixel´s horizontal position to the right
  • oy:Integer = the pixel´s vertical position down
  • oFrom:__Ink = the desired ink
Um ein Pixel des VGOs auf eine gewünschte Ink zu setzen (die alte wird durch diese ausgetauscht), verwende VGO_setPixel.
  • var oTo:__VGO = dein VGO
  • ox:Integer = des Pixels horizontale Position nach rechts
  • oy:Integer = des Pixels vertikale Position nach unten
  • oFrom:__Ink = die gewünschte Ink
VGO_clear(lVGO,VGO_ink($000F));
VGO_setPixel(lVGO,30,30,VGO_ink($F00F));
VGO_setPixel(lVGO,100,50,VGO_ink($FF0F));
VGO_setPixel(lVGO,64,100,VGO_ink($0FFF));

VGO_putPixel

back to the index · zurück zum Index
To put an ink dot on a pixel (like drawing on it), use VGO_putPixel. This does not replace the old ink, but use it as a background for painting on with a more or less transparent ink.
  • var oTo:__VGO = your VGO
  • ox:Integer = the pixel´s horizontal position to the right
  • oy:Integer = the pixel´s vertical position down
  • oFrom:__Ink = the ink to be used
Um einen Ink-Tropfen auf ein Pixel aufzutragen, verwende VGO_putPixel. Die alte Ink wird dadurch nicht ersetzt, sondern ist Hintergrundfarbe für die mehr oder weniger transparente oFrom.
  • var oTo:__VGO = dein VGO
  • ox:Integer = des Pixels horizontale Position nach rechts
  • oy:Integer = des Pixels vertikale Position nach unten
  • oFrom:__Ink = die zu verwendende Ink
VGO_clear(lVGO,VGO_ink($000F));
VGO_putPixel(lVGO,10,20,VGO_ink($FFFF));
VGO_putPixel(lVGO,30,30,VGO_ink($FFFC));
VGO_putPixel(lVGO,50,40,VGO_ink($FFF9));
VGO_putPixel(lVGO,70,50,VGO_ink($FFF6));
VGO_putPixel(lVGO,90,60,VGO_ink($FFF3));

VGO_drawPoint

back to the index · zurück zum Index
If you want to draw a point that may have a position that does not sit directly on the bitmap pixel grid, you can use VGO_drawPoint, which will interpolate it (like a digital camera would).
  • var oTo:__VGO = your VGO
  • ox:Real = the pixel´s horizontal position to the right
  • oy:Real = the pixel´s vertical position down
  • oFrom:__Ink = the ink to be used
Please note: this effect looks best in animations (imagine little points wiggling along the screen), not so much on static images.
Wenn du einen Punkt malen möchtest, dessen Position nicht unbedingt direkt auf dem Bitmap-Pixel-Gitter liegt, kannst du VGO_drawPoint verwenden, das sich um die Interpolation kümmert (funktioniert wie eine digitale Kamera).
  • var oTo:__VGO = dein VGO
  • ox:Real = des Pixels horizontale Position nach rechts
  • oy:Real = des Pixels vertikale Position nach unten
  • oFrom:__Ink = die zu verwendende Ink
Hinweis: dieser Effekt wirkt am besten in Animationen (stell dir kleine über den Bildschirm wuselnde Pünktchen vor), weniger bei Standbildern.
VGO_clear(lVGO,VGO_ink($000F));
VGO_drawPoint(lVGO,40,40,VGO_ink($FF0F));
VGO_drawPoint(lVGO,60.5,60.5,VGO_ink($FF0F));
VGO_drawPoint(lVGO,80.2,80.65,VGO_ink($FF0F));

VGO_setLine

back to the index · zurück zum Index
Use this to replace all the pixels along a line with a desired ink.
  • var oTo:__VGO = your VGO
  • ox1:Integer = starting point horizontal position to the right
  • oy1:Integer = starting point vertical position down
  • ox2:Integer = end point horizontal position to the right
  • oy2:Integer = end point vertical position down
  • oFrom:__Ink = the desired ink
Verwende dies, um alle Pixel entlang einer Linie mit einer gewünschten Ink zu ersetzen.
  • var oTo:__VGO = dein VGO
  • ox1:Integer = des Startpunkts horizontale Position nach rechts
  • oy1:Integer = des Startpunkts vertikale Position nach unten
  • ox2:Integer = des Endpunkts horizontale Position nach rechts
  • oy2:Integer = des Endpunkts vertikale Position nach unten
  • oFrom:__Ink = die gewünschte Ink
VGO_clear(lVGO,VGO_ink($000F));
VGO_setLine(lVGO,35,55,100,100,VGO_ink($F0FF));
VGO_setLine(lVGO,20,100,100,20,VGO_ink($0FFF));
VGO_setLine(lVGO,15,20,110,25,VGO_ink($FF0F));

VGO_setLineDotted

back to the index · zurück zum Index
This does the same as VGO_setLine, but skips every second pixel.
  • var oTo:__VGO = your VGO
  • ox1:Integer = starting point horizontal position to the right
  • oy1:Integer = starting point vertical position down
  • ox2:Integer = end point horizontal position to the right
  • oy2:Integer = end point vertical position down
  • oFrom:__Ink = the desired ink
Dies macht das gleiche wie VGO_setLine, überspringt aber jeden zweiten Pixel.
  • var oTo:__VGO = dein VGO
  • ox1:Integer = des Startpunkts horizontale Position nach rechts
  • oy1:Integer = des Startpunkts vertikale Position nach unten
  • ox2:Integer = des Endpunkts horizontale Position nach rechts
  • oy2:Integer = des Endpunkts vertikale Position nach unten
  • oFrom:__Ink = die gewünschte Ink
VGO_clear(lVGO,VGO_ink($000F));
VGO_setLineDotted(lVGO,35,55,100,100,VGO_ink($F0FF));
VGO_setLineDotted(lVGO,20,100,100,20,VGO_ink($0FFF));
VGO_setLineDotted(lVGO,15,20,110,25,VGO_ink($FF0F));

VGO_putLine

back to the index · zurück zum Index
To draw a more or less transparent pixel line on the VGO, use VGO_putLine.
  • var oTo:__VGO = your VGO
  • ox1:Integer = starting point horizontal position to the right
  • oy1:Integer = starting point vertical position down
  • ox2:Integer = end point horizontal position to the right
  • oy2:Integer = end point vertical position down
  • oFrom:__Ink = the ink to be used
Verwende VGO_putLine, um eine mehr oder weniger transparente Pixel-Linie auf dem VGO zu malen.
  • var oTo:__VGO = dein VGO
  • ox1:Integer = des Startpunkts horizontale Position nach rechts
  • oy1:Integer = des Startpunkts vertikale Position nach unten
  • ox2:Integer = des Endpunkts horizontale Position nach rechts
  • oy2:Integer = des Endpunkts vertikale Position nach unten
  • oFrom:__Ink = die zu verwendende Ink
VGO_clear(lVGO,VGO_ink($000F));
VGO_putLine(lVGO,30,30,100,10,VGO_ink($9C6F));
VGO_putLine(lVGO,35,40,105,30,VGO_ink($9C6C));
VGO_putLine(lVGO,40,50,110,50,VGO_ink($9C69));
VGO_putLine(lVGO,45,60,115,70,VGO_ink($9C66));
VGO_putLine(lVGO,50,70,120,90,VGO_ink($9C63)); 

VGO_drawLine

back to the index · zurück zum Index
For smooth lines without pixel jumps, use VGO_drawLine. The position for the starting and the end point are Real, so you are not restricted to the bitmap pixel grid.
  • var oTo:__VGO =
  • ox1:Real = starting point horizontal position to the right
  • oy1:Real = starting point vertical position down
  • ox2:Real = end point horizontal position to the right
  • oy2:Real = end point vertical position down
  • oFrom:__Ink = the ink to be used
Für weiche Linien ohne Pixelsprünge, verwende VGO_drawLine. Die Position des Start- und des Endpunkts sind Real, du bist also nicht an das Bitmap-Pixel-Gitter gebunden.
  • var oTo:__VGO = dein VGO
  • ox1:Real = des Startpunkts horizontale Position nach rechts
  • oy1:Real = des Startpunkts vertikale Position nach unten
  • ox2:Real = des Endpunkts horizontale Position nach rechts
  • oy2:Real = des Endpunkts vertikale Position nach unten
  • oFrom:__Ink = die zu verwendende Ink
VGO_clear(lVGO,VGO_ink($000F));
VGO_drawLine(lVGO,35,55,100,100,VGO_ink($F0FF));
VGO_drawLine(lVGO,20,100,100,20,VGO_ink($0FFF));
VGO_drawLine(lVGO,15,20,110,25,VGO_ink($FF0F));

VGO_drawLine2

back to the index · zurück zum Index
This works like VGO_drawLine, but you can define a different ink for the starting and for the end point. The procedure will interpolate the color smoothly between them.
  • var oTo:__VGO =
  • ox1:Real = starting point horizontal position to the right
  • oy1:Real = starting point vertical position down
  • ox2:Real = end point horizontal position to the right
  • oy2:Real = end point vertical position down
  • oC1:__Ink = the ink at the starting point
  • oC2:__Ink = the ink at the end point
Funktioniert wie VGO_drawLine, du kannst dem Start- und dem Endpunkt jedoch unterschiedliche Inks geben. Die Prozedur interpoliert zwischen beiden einen weichen Farbverlauf.
  • var oTo:__VGO = dein VGO
  • ox1:Real = des Startpunkts horizontale Position nach rechts
  • oy1:Real = des Startpunkts vertikale Position nach unten
  • ox2:Real = des Endpunkts horizontale Position nach rechts
  • oy2:Real = des Endpunkts vertikale Position nach unten
  • oC1:__Ink = die Ink am Startpunkt
  • oC2:__Ink = die Ink am Endpunkt
VGO_clear(lVGO,VGO_ink($000F));
VGO_drawLine2(lVGO,35,55,100,100,VGO_ink($F0FF),VGO_ink($F0F0));
VGO_drawLine2(lVGO,20,100,100,20,VGO_ink($0FFF),VGO_ink($FF0F));
VGO_drawLine2(lVGO,15,20,110,25,VGO_ink($AFAC),VGO_ink($FAAF));

VGO_drawRing

back to the index · zurück zum Index
To draw a circle ring (antialiased) on the VGO.
  • var oTo:__VGO = your VGO
  • ox:Real = the ring center´s horizontal position to the right
  • oy:Real = the ring center´s vertical position down
  • od:Real = the diameter of the ring
  • oFrom:__Ink = the ink to be used
Dient dem Zeichnen eines Kreisrings (antialiased) auf dem VGO.
  • var oTo:__VGO = dein VGO
  • ox:Real = des Kreiszentrums horizontale Position nach rechts
  • oy:Real = des Kreiszentrums vertikale Position nach unten
  • od:Real = der Ringdurchmesser
  • oFrom:__Ink = die zu verwendende Ink
VGO_clear(lVGO,VGO_ink($000F));
VGO_drawRing(lVGO,63,64.6,100,VGO_ink($FA5F));

VGO_drawTorus

back to the index · zurück zum Index
If you want to draw a thick ring, or even a filled circle, use VGO_drawTorus, which lets you define and inner and an outer diameter.
  • var oTo:__VGO = your VGO
  • ox:Real = the center´s horizontal position to the right
  • oy:Real = the center´s vertical position down
  • odi:Real = the inner diameter of the torus
  • odo:Real = the outer diameter of the torus
  • oFrom:__Ink = the ink to be used
Wenn du einen dicken Ring oder sogar eine Kreisscheibe zeichnen möchtest, dann verwende VGO_drawTorus, bei dem du einen inneren und einen äußeren Durchmesser angeben kannst.
  • var oTo:__VGO = dein VGO
  • ox:Real = des Zentrums horizontale Position nach rechts
  • oy:Real = des Zentrums vertikale Position nach unten
  • odi:Real = der innere Torusdurchmesser
  • odo:Real = der äußere Torusdurchmesser
  • oFrom:__Ink = die zu verwendende Ink
VGO_clear(lVGO,VGO_ink($000F));
VGO_drawTorus(lVGO,63,64.6,50,100,VGO_ink($A5FF));

VGO_drawTorus2

back to the index · zurück zum Index
This lets you draw a torus with a smooth ink gradient from inner to outer diameter.
  • var oTo:__VGO = your VGO
  • ox:Real = the center´s horizontal position to the right
  • oy:Real = the center´s vertical position down
  • odi:Real = the inner diameter of the torus
  • odo:Real = the outer diameter of the torus
  • oCi:__Ink = the ink at the inner diameter
  • oCo:__Ink = the ink at the outer diameter
Hiermit kannst du einen Torus zeichnen, der einen weichen Farbverlauf vom Innen- zum Außendurchmesser aufweist.
  • var oTo:__VGO = dein VGO
  • ox:Real = des Zentrums horizontale Position nach rechts
  • oy:Real = des Zentrums vertikale Position nach unten
  • odi:Real = der innere Torusdurchmesser
  • odo:Real = der äußere Torusdurchmesser
  • oCi:__Ink = die Ink beim Innendurchmesser
  • oCo:__Ink = die Ink beim Außendurchmesser
VGO_clear(lVGO,VGO_ink($000F));
VGO_drawTorus2(lVGO,63,64.6,30,100,VGO_ink($F00F),VGO_ink($0F0F));
VGO_clear(lVGO,VGO_ink($000F));
VGO_drawTorus2(lVGO,63,64.6,0,100,VGO_ink($80FF),VGO_ink($0F01));

VGO_setRect

back to the index · zurück zum Index
To set all pixels of a rectangular region in the VGO to a desired ink.
  • var oTo:__VGO = your VGO
  • oRectA:__RectA = defines the region that shall be affected
  • oFrom:__Ink = the desired ink
Dient dazu, alle Pixel eines rechteckigen Bereichs des VGOs auf eine gewünschte Ink zu setzen.
  • var oTo:__VGO = dein VGO
  • oRectA:__RectA = definiert den Zielbereich
  • oFrom:__Ink = die gewünschte Ink
VGO_clear(lVGO,VGO_ink($000F));
VGO_setRect(lVGO,MakeRectA(32,18,80,60),VGO_ink($96CF));

VGO_putRect

back to the index · zurück zum Index
To tint a rectangular region in the VGO with a desired (more or less transparent) ink.
  • var oTo:__VGO = your VGO
  • oRectA:__RectA = defines the region that shall be affected
  • oFrom:__Ink = the ink to be used
Dient dazu, einen rechteckigen Bereichs des VGOs mit einer gewünschten (mehr oder weniger transparenten) Ink zu bemalen.
  • var oTo:__VGO = dein VGO
  • oRectA:__RectA = definiert den Zielbereich
  • oFrom:__Ink = die zu verwendende Ink
VGO_clear(lVGO,VGO_ink($000F));
VGO_putRect(lVGO,MakeRectA(32,18,80,60),VGO_ink($96CF));
VGO_putRect(lVGO,MakeRectA(20,50,50,50),VGO_ink($3F6A));

VGO_putRect4

back to the index · zurück zum Index
To draw a filled rectangle with smooth ink transitions between individually colored corners.
  • var oTo:__VGO = your VGO
  • oRectA:__RectA = defines the region that shall be affected
  • oITL:__Ink = color for the top left corner
  • oITR:__Ink = color for the top right corner
  • oIBL:__Ink = color for the bottom left corner
  • oIBR:__Ink = color for the bottom right corner
Dient zum Malen eines gefüllten Rechtecks mit weichen Ink-Verläufen zwischen jeweils andersfarbigen Ecken.
  • var oTo:__VGO = dein VGO
  • oRectA:__RectA = definiert den Zielbereich
  • oITL:__Ink = Farbe der Ecke oben links
  • oITR:__Ink = Farbe der Ecke oben rechts
  • oIBL:__Ink = Farbe der Ecke unten links
  • oIBR:__Ink = Farbe der Ecke unten rechts
VGO_clear(lVGO,VGO_ink($000F));
VGO_putRect4(lVGO,MakeRectA(32,18,80,60),
             VGO_ink($FFFF),VGO_ink($F008),
             VGO_ink($F00F),VGO_ink($F000));
VGO_putRect4(lVGO,MakeRectA(20,50,50,50),
             VGO_ink($F00A),VGO_ink($0F0F),
             VGO_ink($00F5),VGO_ink($FF08));

VGO_markupRect

back to the index · zurück zum Index
This XOR-es a rectangular area of the VGO with a desired ink.
  • var oTo:__VGO = your VGO
  • oRectA:__RectA = defines the region that shall be affected
  • oMask:__Ink = the ink to be used as an XOR mask
Dies XOR-t einen rechteckigen Bereich des VGOs mit einer gewünschten Ink.
  • var oTo:__VGO = dein VGO
  • oRectA:__RectA = definiert den Zielbereich
  • oMask:__Ink = die als XOR-Maske zu verwendende Ink
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_markupRect(lVGO,MakeRectA(32,18,80,60),VGO_ink($5550));

VGO_setBorder

back to the index · zurück zum Index
To set all pixels of a rectangular frame with a desired width to a certain ink. Returns the inner region within the border.
  • var oTo:__VGO = your VGO
  • oRectA:__RectA = defines the region that shall be affected
  • oSize:Byte = the width of the border
  • oFrom:__Ink = the desired ink
  • result:__RectA
Dient dazu, alle Pixel eines rechteckigen Rahmens von gewünschter Breite auf eine bestimmte Ink zu setzen. Gibt den Bereich innerhalb des Rahmens zurück.
  • var oTo:__VGO = dein VGO
  • oRectA:__RectA = definiert den Zielbereich
  • oSize:Byte = die Breite des Randes
  • oFrom:__Ink = die gewünschte Ink
  • result:__RectA
VGO_clear(lVGO,VGO_ink($000F));
VGO_setBorder(lVGO,MakeRectA(32,18,80,60),15,VGO_ink($A05F));
VGO_clear(lVGO,VGO_ink($000F));
lRectA := MakeRectA(32,18,80,60);
lRectA := VGO_setBorder(lVGO,lRectA,15,VGO_ink($A05F));
lRectA := VGO_setBorder(lVGO,lRectA,5,VGO_ink($AC5F));
VGO_setBorder(lVGO,lRectA,2,VGO_ink($0CCF));

VGO_putBorder

back to the index · zurück zum Index
To draw a rectangular frame with a desired width and a certain (more or less transparent) ink. Returns the inner region within the border.
  • var oTo:__VGO = your VGO
  • oRectA:__RectA = defines the region that shall be affected
  • oSize:Byte = the width of the border
  • oFrom:__Ink = the ink to be used
  • result:__RectA
Dient dazu, einen rechteckigen Rahmen von gewünschter Breite und mit einer bestimmten Ink zu malen. Gibt den Bereich innerhalb des Rahmens zurück.
  • var oTo:__VGO = dein VGO
  • oRectA:__RectA = definiert den Zielbereich
  • oSize:Byte = die Breite des Randes
  • oFrom:__Ink = die zu verwendende Ink
  • result:__RectA
VGO_clear(lVGO,VGO_ink($000F));
VGO_putBorder(lVGO,MakeRectA(32,18,80,60),9,VGO_ink($96CF));
VGO_putBorder(lVGO,MakeRectA(20,50,50,50),15,VGO_ink($3F6A));

VGO_setBorder2

back to the index · zurück zum Index
Works like VGO_setBorder, but you can define different colors for the inner and the outer edge, between which a smooth color transition will be generated. Returns the inner region within the border.
  • var oTo:__VGO = your VGO
  • oRectA:__RectA = defines the region that shall be affected
  • oSize:Byte = the width of the border
  • oCo:__Ink = the ink of the outer edge
  • oCi:__Ink = the ink of the inner edge
  • result:__RectA
Funktioniert wie VGO_setBorder, du kannst aber der Innen- und der Außenkante jeweils eine andere Farbe zuweisen, zwischen denen ein weicher Farbverlauf generiert wird. Gibt den Bereich innerhalb des Rahmens zurück.
  • var oTo:__VGO = dein VGO
  • oRectA:__RectA = definiert den Zielbereich
  • oSize:Byte = die Breite des Randes
  • oCo:__Ink = die Ink außen
  • oCi:__Ink = die Ink innen
  • result:__RectA
VGO_clear(lVGO,VGO_ink($000F));
VGO_setBorder2(lVGO,MakeRectA(32,18,80,60),9,
               VGO_ink($FF0F),VGO_ink($693F));

VGO_putBorder2

back to the index · zurück zum Index
Works like VGO_putBorder, but you can define different colors for the inner and the outer edge, between which a smooth color transition will be generated. Returns the inner region within the border.
  • var oTo:__VGO = your VGO
  • oRectA:__RectA = defines the region that shall be affected
  • oSize:Byte = the width of the border
  • oCo:__Ink = the ink of the outer edge
  • oCi:__Ink = the ink of the inner edge
  • result:__RectA
Funktioniert wie VGO_putBorder, du kannst aber der Innen- und der Außenkante jeweils eine andere Farbe zuweisen, zwischen denen ein weicher Farbverlauf generiert wird. Gibt den Bereich innerhalb des Rahmens zurück.
  • var oTo:__VGO = dein VGO
  • oRectA:__RectA = definiert den Zielbereich
  • oSize:Byte = die Breite des Randes
  • oCo:__Ink = die Ink außen
  • oCi:__Ink = die Ink innen
  • result:__RectA
VGO_clear(lVGO,VGO_ink($000F));
VGO_putBorder2(lVGO,MakeRectA(32,18,80,60),9,
               VGO_ink($FF0F),VGO_ink($693F));
VGO_putBorder2(lVGO,MakeRectA(20,50,50,50),15,
               VGO_ink($0C05),VGO_ink($0C9A));

VGO_outline

back to the index · zurück zum Index
Now this is a very special procedure. It creates an outline around all non-fully-transparent pixels of the VGO, and works therefore only on non-solid VGOs. (Such are usually not directly displayed on a TImage, but rather used as stamp on a background VGO, which is then eventually displayed.)
  • var oVGO:__VGO = your VGO
  • oInk:__Ink = the ink for the outline
  • oSize:Byte = the width of the outline
  • oIncDims:Boolean = increase the dimensions of your VGO by twice the width of the outline?
Dies ist eine sehr spezielle Procedure. Sie erzeugt eine Umrandungslinie um alle nicht komplett transparenten Pixel des VGOs, und funktioniert daher nur bei nicht-soliden VGOs. (Solche werden für gewöhnlich nicht direkt auf einem TImage angezeigt, sondern als Stempel auf einem Hintergrund-VGO eingesetzt, welches dann schließlich angezeigt wird.)
  • var oVGO:__VGO = dein VGO
  • oInk:__Ink = die Ink für die Umrandungslinie
  • oSize:Byte = die Breite der Umrandungslinie
  • oIncDims:Boolean = vergrößere dein VGO um die doppelte Breite der Umrandungslinie?
VGO_clear(lVGO,0);
VGO_drawLine(lVGO,35,55,100,100,VGO_ink($060F));
VGO_drawLine(lVGO,20,100,100,20,VGO_ink($060F));
VGO_drawLine(lVGO,15,20,110,25,VGO_ink($060F));
VGO_outline(lVGO,VGO_ink($FFFF),3,false);
VGO_outline(lVGO,VGO_ink($000F),3,false);
VGO_outline(lVGO,VGO_ink($FDFF),2,false);
VGO_outline(lVGO,VGO_ink($200F),2,false);
VGO_outline(lVGO,VGO_ink($FBFF),1,false);
VGO_outline(lVGO,VGO_ink($400F),1,false);
VGO_clear(lVGO,0);
VGO_drawLine(lVGO,35,55,100,100,VGO_ink($060F));
VGO_drawLine(lVGO,20,100,100,20,VGO_ink($060F));
VGO_drawLine(lVGO,15,20,110,25,VGO_ink($060F));
VGO_outline(lVGO,VGO_ink($FFF8),3,false);
VGO_outline(lVGO,VGO_ink($0008),3,false);
VGO_outline(lVGO,VGO_ink($FDF8),2,false);
VGO_outline(lVGO,VGO_ink($2008),2,false);
VGO_outline(lVGO,VGO_ink($FBF8),1,false);
VGO_outline(lVGO,VGO_ink($4008),1,false);
VGO_clear(lVGO,0);
VGO_drawLine(lVGO,35,55,100,100,VGO_ink($060F));
VGO_drawLine(lVGO,20,100,100,20,VGO_ink($060F));
VGO_drawLine(lVGO,15,20,110,25,VGO_ink($060F));
VGO_outline(lVGO,VGO_ink($FFF4),3,false);
VGO_outline(lVGO,VGO_ink($0004),3,false);
VGO_outline(lVGO,VGO_ink($FDF4),2,false);
VGO_outline(lVGO,VGO_ink($2004),2,false);
VGO_outline(lVGO,VGO_ink($FBF4),1,false);
VGO_outline(lVGO,VGO_ink($4004),1,false);

VGO_framer

back to the index · zurück zum Index
This function creates an attractive 3D frame (4 modes available) and returns the inner region within it.
  • var oVGO:__VGO = your VGO
  • oRectA:__RectA = the outer dimensions of the frame
  • oSize:Byte = the width of the frame
  • oStrength:Byte = the strength (opacity) of the effect
  • oMode:Byte = the frame mode
    • 0 = push frame
    • 1 = pull frame
    • 2 = dig frame
    • 3 = put frame
  • result:__RectA
Diese Function erzeugt einen attraktiven 3D-Rahmen (4 Modi verfügbar) und gibt den von ihm eingeschlossenen Bereich zurück.
  • var oVGO:__VGO = dein VGO
  • oRectA:__RectA = die äußeren Dimensionen des Rahmens
  • oSize:Byte = die Breite des Rahmens
  • oStrength:Byte = die Stärke (Deckkraft) des Effekts
  • oMode:Byte = der Rahmen-Modus
    • 0 = Eindrück-Rahmen
    • 1 = Hochzieh-Rahmen
    • 2 = Eingrab-Rahmen
    • 3 = Aufsetz-Rahmen
  • result:__RectA
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
lRectA := MakeRectA(15,15,100,80);
lRectA := VGO_framer(lVGO,lRectA,7,$AA,1);
lRectA := VGO_framer(lVGO,lRectA,7,$55,0);
lRectA := VGO_framer(lVGO,lRectA,9,$88,3);
VGO_framer(lVGO,lRectA,9,$66,2);
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_framer(lVGO,MakeRectA(32,18,80,60),15,$ff,0); // push mode
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_framer(lVGO,MakeRectA(32,18,80,60),15,$ff,1); // pull mode
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_framer(lVGO,MakeRectA(32,18,80,60),15,$ff,2); // dig mode
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_framer(lVGO,MakeRectA(32,18,80,60),15,$ff,3); // put mode

VGO_framerPlus

back to the index · zurück zum Index
Works like VGO_framer, but offers additional shading: down-frames will render the inner region darker, up-frames lighter. Returns the inner region within the frame.
  • var oVGO:__VGO = your VGO
  • oRectA:__RectA = the outer dimensions of the frame
  • oSize:Byte = the width of the frame
  • oStrength:Byte = the strength (opacity) of the effect
  • oMode:Byte = the frame mode
    • 0 = push frame
    • 1 = pull frame
    • 2 = dig frame
    • 3 = put frame
  • oShading:Byte = the strength of the shading effect
  • result:__RectA
Funktioniert wie VGO_framer, bietet aber zusätzlich eine Helligkeitsanpassung (Shading): Niederrahmen machen den inneren Bereich dunkler, Hochrahmen heller. Gibt den vom Rahmen eingeschlossenen Bereich zurück.
  • var oVGO:__VGO = dein VGO
  • oRectA:__RectA = die äußeren Dimensionen des Rahmens
  • oSize:Byte = die Breite des Rahmens
  • oStrength:Byte = die Stärke (Deckkraft) des Effekts
  • oMode:Byte = der Rahmen-Modus
    • 0 = Eindrück-Rahmen
    • 1 = Hochzieh-Rahmen
    • 2 = Eingrab-Rahmen
    • 3 = Aufsetz-Rahmen
  • oShading:Byte = die Stärke des Shading-Effekts
  • result:__RectA
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_framerPlus(lVGO,MakeRectA(15,15,100,80),15,$CC,0,$33);
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_framerPlus(lVGO,MakeRectA(15,15,100,80),15,$CC,1,$33);

VGO_screenCapture

back to the index · zurück zum Index
This captures what is visible on the screen in a rectangular region of interest, and makes a VGO from it. (There´s no need to VGO_setupX the VGO before.)
  • var oTo:__VGO = this will become the new VGO
  • ox:Integer = left edge position of the screen region
  • oy:Integer = top edge position of the screen region
  • ow:Integer = width of the image
  • oh:Integer = height of the image
Dies fotografiert gewissermaßen einen rechteckigen Bereich dessen, was gerade auf dem Bildschirm zu sehen ist, und erstellt daraus ein VGO. (Das VGO braucht dazu nicht zuvor mit VGO_setupX initialisiert worden zu sein.)
  • var oTo:__VGO = dies wird das neue VGO
  • ox:Integer = Position der linken Kante des Bildschirmausschnitts
  • oy:Integer = Position der Oberkante des Bildschirmausschnitts
  • ow:Integer = Breite des Bildes
  • oh:Integer = Höhe des Bildes
VGO_screenCapture(lVGO,0,0,pic.Width,pic.Height);

VGO_simpleBlur

back to the index · zurück zum Index
Use this to blur a VGO image by a desired degree. Warning: setting oSize to high values will take a long time to compute (and the result won´t be that pretty anyhow)!
  • var oVGO:__VGO = your VGO
  • oSize:Byte = strength of the blur effect (1 may be enough!)
    the blur effect will overlay the VGO by 2*oSize+1 pixels square
Verwende dies, um ein VGO-Bild unscharf zu machen. Warnung: hohe Werte für oSize bedeuten einen sehr langen Rechenaufwand (und das Ergebnis wird nichtmal sonderlich schön aussehen)!
  • var oVGO:__VGO = dein VGO
  • oSize:Byte = Stärke des Unschärfe-Effects (1 reicht meist!)
    der Unschärfe-Effekt verwischt das VGO um 2*oSize+1 Pixel im Quadrat
VGO_screenCapture(lVGO,0,0,pic.Width,pic.Height);
VGO_simpleBlur(lVGO,1);
VGO_screenCapture(lVGO,0,0,pic.Width,pic.Height);
VGO_simpleBlur(lVGO,2);
VGO_screenCapture(lVGO,0,0,pic.Width,pic.Height);
VGO_simpleBlur(lVGO,3);
VGO_screenCapture(lVGO,0,0,pic.Width,pic.Height);
VGO_simpleBlur(lVGO,5);
VGO_screenCapture(lVGO,0,0,pic.Width,pic.Height);
VGO_simpleBlur(lVGO,20); // already > 1s (my PC)

VGO_grain

back to the index · zurück zum Index
Creates some random pixel noise (the intensity is your choice) on the VGO.
  • var oVGO:__VGO = your VGO
  • oGrain:Byte = intensity (opacity) of the pixel noise
Erzeugt zufälliges Pixelrauschen (voreinstellbare Intensität) auf dem VGO.
  • var oVGO:__VGO = dein VGO
  • oGrain:Byte = die Intensität (Deckkraft) des Pixelrauschens
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
// here only for comparison
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_grain(lVGO,5); // see any difference yet?
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_grain(lVGO,10);
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_grain(lVGO,20);
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_grain(lVGO,44); // roughly 25%
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_grain(lVGO,88); // roughly 50%
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_grain(lVGO,FF); // full power!

VGO_scanlines

back to the index · zurück zum Index
This generates black scanlines like on an old computer screen (selectable intensity).
  • var oVGO:__VGO = your VGO
  • oStrength:Byte = intensity (opacity) of the scanlines effect
Dies erzeugt schwarze Rasterlinien, wie auf einem alten Computerbildschirm (wählbare Intensität).
  • var oVGO:__VGO = dein VGO
  • oStrength:Byte = die Intensität (Deckkraft) des Rasterlinieneffekts
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_scanlines(lVGO,$11);
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_scanlines(lVGO,$33);
VGO_clear4(lVGO,VGO_ink($F00F),VGO_ink($0F0F),
                VGO_ink($00FF),VGO_ink($FF0F));
VGO_scanlines(lVGO,$88);

VGO_duplicate

back to the index · zurück zum Index
With this procedure you can create a duplicate copy of a VGO.
  • var oTo:__VGO = the destination (copy) VGO
  • oFrom:__VGO = the source (original) VGO
Mit dieser Procedure kannst du eine Kopie von einem VGO erzeugen.
  • var oTo:__VGO = das neue Ziel-VGO (Kopie)
  • oFrom:__VGO = das Quell-VGO (Original)

VGO_setMerge

back to the index · zurück zum Index
This lets you replace a region of a VGO with a second VGO.
  • var oTo:__VGO = the destination VGO
  • ox:Integer = horizontal offset of the source focus into the destination
  • oy:Integer = vertical offset of the source focus into the destination
  • oFrom:__VGO = the source VGO
Dies ermöglicht das Ersetzen eines Bereichs eines VGOs durch ein zweites VGO.
  • var oTo:__VGO = das Ziel-VGO
  • ox:Integer = horizontaler Versatz des Quellfokus im Ziel-VGO
  • oy:Integer = vertikaler Versatz des Quellfokus im Ziel-VGO
  • oFrom:__VGO = das Quell-VGO
VGO_clear(lVGO,VGO_ink($000F));
// make some stamp:
VGO_setupX(lStamp,30,30);
VGO_clear4(lStamp,VGO_ink($F00F),VGO_ink($0F0F),
                  VGO_ink($00FF),VGO_ink($FF0F));
VGO_drawTorus2(lStamp,15,15,5,15,
               VGO_ink($0005),VGO_ink($5FAC));
VGO_drawTorus2(lStamp,15,15,15,25,
               VGO_ink($5FAC),VGO_ink($0081));
// use the stamp:
VGO_setMerge(lVGO,30,40,lStamp);
VGO_setMerge(lVGO,70,65,lStamp);
VGO_setMerge(lVGO,50,85,lStamp);

VGO_putMerge

back to the index · zurück zum Index
This lets you stamp a VGO onto another.
  • var oTo:__VGO = the destination VGO
  • ox:Integer = horizontal offset of the source focus into the destination
  • oy:Integer = vertical offset of the source focus into the destination
  • oFrom:__VGO = the source VGO
Note: you can manipulate __VGO.opacity to make the stamp more or less transparent; and with __VGO.focusx and __VGO.focusy you can offset the stamp against ox and oy, just as with a mouse pointer icon (see examples below).
Hiermit kannst du ein VGO auf ein anderes aufstempeln.
  • var oTo:__VGO = das Ziel-VGO
  • ox:Integer = horizontaler Versatz des Quellfokus im Ziel-VGO
  • oy:Integer = vertikaler Versatz des Quellfokus im Ziel-VGO
  • oFrom:__VGO = das Quell-VGO
Hinweis: du kannst __VGO.opacity verändern, um den Stempel mehr oder weniger transparent zu machen; und mit __VGO.focusx und __VGO.focusy kannst du den Stempel gegenüber ox und oy versetzen, etwa wie für Mauszeiger-Icons (siehe die Beispiele unten).
VGO_clear(lVGO,VGO_ink($000F));
// make some stamp:
VGO_setupX(lStamp,30,30);
VGO_clear4(lStamp,VGO_ink($F00F),VGO_ink($0F0F),
                  VGO_ink($00FF),VGO_ink($FF0F));
VGO_drawTorus2(lStamp,15,15,5,15,
               VGO_ink($0005),VGO_ink($5FAC));
VGO_drawTorus2(lStamp,15,15,15,25,
               VGO_ink($5FAC),VGO_ink($0081));
// use the stamp:
VGO_putMerge(lVGO,30,40,lStamp);
lStamp.opacity := $88; // stamp with transparency!
VGO_putMerge(lVGO,70,65,lStamp);
VGO_putMerge(lVGO,50,85,lStamp);
VGO_clear(lVGO,VGO_ink($000F));
// make a simple mouse pointer:
VGO_setupX(lStamp,25,25);
VGO_clear(lStamp,0); // fully transparent
lInk := VGO_ink($FC9F); // bright green
VGO_drawLine(lStamp,0,2,2,0,lInk);
VGO_drawLine(lStamp,2,0,15,5,lInk);
VGO_drawLine(lStamp,0,2,5,15,lInk);
VGO_drawLine(lStamp,15,5,10,8,lInk);
VGO_drawLine(lStamp,5,15,8,10,lInk);
VGO_drawLine(lStamp,10,8,25,25,lInk);
VGO_drawLine(lStamp,8,10,25,25,lInk);
// red dots show where the user points:
lInk := VGO_ink($0F0F); // red
VGO_setPixel(lVGO,30,40,lInk);
VGO_setPixel(lVGO,70,65,lInk);
VGO_setPixel(lVGO,50,85,lInk);
// use the stamp:
VGO_putMerge(lVGO,30,40,lStamp);
VGO_putMerge(lVGO,70,65,lStamp);
lStamp.opacity := $55; // transparent
VGO_putMerge(lVGO,50,85,lStamp);
VGO_clear(lVGO,VGO_ink($000F));
// make a crosshairs pointer
// with the FOCUS in the VGO center:
VGO_setup(lStamp,20,20,10,10,$FF);
VGO_clear(lStamp,VGO_ink($FF05));
lInk := VGO_ink($FC9F); // bright green
VGO_setLine(lStamp,10,0,10,5,lInk);
VGO_setLine(lStamp,10,20,10,15,lInk);
VGO_setLine(lStamp,0,10,5,10,lInk);
VGO_setLine(lStamp,20,10,15,10,lInk);
// red dots show where the user points:
lInk := VGO_ink($0F0F); // red
VGO_setPixel(lVGO,30,40,lInk);
VGO_setPixel(lVGO,70,65,lInk);
VGO_setPixel(lVGO,50,85,lInk);
// use the stamp:
VGO_putMerge(lVGO,30,40,lStamp);
VGO_putMerge(lVGO,70,65,lStamp);
lStamp.opacity := $55; // transparent
// strip away the focus offset:
lStamp.focusx := 0;
lStamp.focusy := 0;
VGO_putMerge(lVGO,50,85,lStamp);

VGO_setCopy

back to the index · zurück zum Index
To replace a rectangular area of a VGO with one from another VGO.
  • var oTo:__VGO = the destination VGO
  • ox:Integer = horizontal offset of the copy into the destination
  • oy:Integer = vertical offset of the copy into the destination
  • oFrom:__VGO = the source VGO
  • oRectA:__RectA = the region of the source that shall be used
Dient dem Ersetzen eines rechteckigen Bereichs in einem VGO durch einen aus einem anderen VGO.
  • var oTo:__VGO = das Ziel-VGO
  • ox:Integer = horizontaler Versatz der Kopie im Ziel-VGO
  • oy:Integer = vertikaler Versatz der Kopie im Ziel-VGO
  • oFrom:__VGO = das Quell-VGO
  • oRectA:__RectA = der zu verwendende Bereich im Quell-VGO
VGO_clear(lVGO,VGO_ink($000F));
// make the stamp from a screen capture:
VGO_screenCapture(lStamp,0,0,128,128);
// use the stamp:
VGO_setCopy(lVGO,30,40,lStamp,MakeRectA(0,0,30,30));
VGO_setCopy(lVGO,70,65,lStamp,MakeRectA(10,20,30,30));
VGO_setCopy(lVGO,50,85,lStamp,MakeRectA(30,80,30,30));
VGO_setCopy(lVGO,80,15,lStamp,MakeRectA(10,20,30,30));

VGO_putCopy

back to the index · zurück zum Index
To stamp a rectangular area out of a VGO onto another one.
  • var oTo:__VGO = the destination VGO
  • ox:Integer = horizontal offset of the copy into the destination
  • oy:Integer = vertical offset of the copy into the destination
  • oFrom:__VGO = the source VGO
  • oRectA:__RectA = the region of the source that shall be used
Dient dem Stempeln eines rechteckigen Bereichs aus einem VGO auf ein anderes.
  • var oTo:__VGO = das Ziel-VGO
  • ox:Integer = horizontaler Versatz der Kopie im Ziel-VGO
  • oy:Integer = vertikaler Versatz der Kopie im Ziel-VGO
  • oFrom:__VGO = das Quell-VGO
  • oRectA:__RectA = der zu verwendende Bereich im Quell-VGO
VGO_clear(lVGO,VGO_ink($000F));
// make the stamp from a screen capture:
VGO_screenCapture(lStamp,0,0,128,128);
// use the stamp:
VGO_putCopy(lVGO,30,40,lStamp,MakeRectA(0,0,30,30));
VGO_putCopy(lVGO,70,65,lStamp,MakeRectA(10,20,30,30));
lStamp.opacity := $CC; // transparency
VGO_putCopy(lVGO,50,85,lStamp,MakeRectA(30,80,30,30));
VGO_putCopy(lVGO,80,15,lStamp,MakeRectA(10,20,30,30));

VGO2BMP

back to the index · zurück zum Index
Use this if you want to save an image created as a VGO to a TBitmap (which does not need to have been initialized before).
  • var oTo:TBitmap = the new destination TBitmap
  • oFrom:__VGO = the source VGO
Verwende dies, wenn du ein als VGO erstelltes Bild in ein TBitmap speichern möchtest. Das TBitmap mußt du vorher nicht extra initialisieren.
  • var oTo:TBitmap = das neue Ziel-TBitmap
  • oFrom:__VGO = das Quell-VGO

BMP2VGO

back to the index · zurück zum Index
Use this if you want to create a VGO from a TBitmap image. The VGO doesn´t need to be initialized before.
  • var oTo:__VGO = the new destination VGO
  • oFrom:TBitmap = the source TBitmap
Verwende dies, wenn du ein VGO von einem TBitmap-Bild erzeugen möchtest. Das VGO mußt du vorher nicht extra initialisieren.
  • var oTo:__VGO = das neue Ziel-VGO
  • oFrom:TBitmap = das Quell-TBitmap

VGO_setOpacity

back to the index · zurück zum Index
To change the opacity of a single pixel in a VGO.
  • var oTo:__VGO = your VGO
  • ox:Integer = the pixel´s horizontal position to the right
  • oy:Integer = the pixel´s vertical position down
  • oFrom:Byte = the desired opacity
Dient dem Ändern der Deckkraft eines einzelnen Pixels in einem VGO.
  • var oTo:__VGO = dein VGO
  • ox:Integer = des Pixels horizontale Position nach rechts
  • oy:Integer = des Pixels vertikale Position nach unten
  • oFrom:Byte = die gewünschte Deckkraft

VGO_mulOpacity

back to the index · zurück zum Index
To fade the opacity of a single pixel in a VGO down.
  • var oTo:__VGO = your VGO
  • ox:Integer = the pixel´s horizontal position to the right
  • oy:Integer = the pixel´s vertical position down
  • oFrom:Byte = the multiplication factor
Dient dem multiplikativen Verblassen der Deckkraft eines einzelnen Pixels in einem VGO.
  • var oTo:__VGO = dein VGO
  • ox:Integer = des Pixels horizontale Position nach rechts
  • oy:Integer = des Pixels vertikale Position nach unten
  • oFrom:Byte = der Multiplikationsfaktor
VGO_mulOpacity(lVGO,lx,ly,lF);
=
lInk := VGO_getPixel(lVGO,lx,ly);
VGO_Ink2GRBO(lInk,lGRBO);
lGRBO := Round(lGRBO*lF/$FF);
lInk := VGO_GRBO2Ink(lGRBO);
VGO_setPixel(lVGO,lx,ly,lInk);

VGO_fadeOpacity

back to the index · zurück zum Index
To fade the opacity of all pixels in a VGO down.
  • var oTo:__VGO = your VGO
  • oFrom:Byte = the multiplication factor
Dient dem multiplikativen Verblassen der Deckkraft sämtlicher Pixel eines VGOs.
  • var oTo:__VGO = dein VGO
  • oFrom:Byte = der Multiplikationsfaktor
// make a background:
VGO_clear(lVGO,VGO_ink($555F));
VGO_grain(lVGO,$88);
VGO_simpleBlur(lVGO,3);
// make some stamp:
VGO_setup(lStamp,30,30,15,15,$FF);
VGO_clear(lStamp,0);
VGO_drawTorus2(lStamp,15,15,0,28,
               VGO_ink($C00F),VGO_ink($300F));
VGO_drawTorus2(lStamp,11,10,0,5,
               VGO_ink($FFFC),VGO_ink($FFF0));
// use the stamp:
VGO_putMerge(lVGO,20,20,lStamp);
VGO_fadeOpacity(lStamp,$BB); // FADE
VGO_putMerge(lVGO,60,40,lStamp);
VGO_fadeOpacity(lStamp,$BB); // FADE
VGO_putMerge(lVGO,100,60,lStamp);
VGO_fadeOpacity(lStamp,$BB); // FADE
VGO_putMerge(lVGO,60,80,lStamp);
VGO_fadeOpacity(lStamp,$BB); // FADE
VGO_putMerge(lVGO,20,100,lStamp);

VGO_GRBO2Ink

back to the index · zurück zum Index
Transforms a __GRBO into an __Ink.
  • oGRBO:__GRBO = the source GRBO
  • result:__Ink
Überträgt einen __GRBO in eine __Ink.
  • oGRBO:__GRBO = der Quell-GRBO
  • result:__Ink

VGO_Ink2GRBO

back to the index · zurück zum Index
Transforms an __Ink into a __GRBO.
  • oFrom:__Ink = the source ink
  • var oTo:__GRBO = the destination GRBO
Überträgt eine __Ink in einen __GRBO.
  • oFrom:__Ink = die Quell-Ink
  • var oTo:__GRBO = der Ziel-GRBO

VGO_TColor2Ink

back to the index · zurück zum Index
Transforms a TColor into an ink. This also supports local Windows color codes!
  • oCol:TColor = the source TColor
  • result:__Ink
Überträgt eine TColor in eine Ink. Dies funktioniert sogar mit lokalen Windows-Farbcodes!
  • oCol:TColor = die QUell-TColor
  • result:__Ink
VGO_clear(lVGO,VGO_TColor2Ink(clBtnFace));
VGO_framer(lVGO,MakeRectA(0,0,128,128),9,$88,3);
lRectA := VGO_framer(lVGO,MakeRectA(15,15,98,98),9,$88,0);
VGO_setRect(lVGO,lRectA,VGO_TColor2Ink(clAqua));

VGO_getPixel

back to the index · zurück zum Index
Returns the ink value of a pixel on a VGO.
  • oFrom:__VGO = the source VGO
  • ox:Integer = the pixel´s horizontal position to the right
  • oy:Integer = the pixel´s vertical position down
  • result:__Ink
Gibt den Ink-Wert eines Pixel aus einem VGO zurück.
  • oFrom:__VGO = das Quell-VGO
  • ox:Integer = des Pixels horizontale Position nach rechts
  • oy:Integer = des Pixels vertikale Position nach unten
  • result:__Ink
VGO_screenCapture(lStamp,0,0,128,128);
For lx:= 0 to 127 do begin
  For ly:= 0 to 127 do begin
    VGO_setPixel(lVGO,ly,lx,VGO_getPixel(lStamp,lx,ly));
  End;
End;

VGO_getOpacity

back to the index · zurück zum Index
Returns the opacity value of a pixel´s ink on a VGO.
  • oFrom:__VGO = the source VGO
  • ox:Integer = the pixel´s horizontal position to the right
  • oy:Integer = the pixel´s vertical position down
  • result:Byte
Gibt den Deckkraft-Wert der Ink eines Pixels aus einem VGO zurück.
  • oFrom:__VGO = das Quell-VGO
  • ox:Integer = des Pixels horizontale Position nach rechts
  • oy:Integer = des Pixels vertikale Position nach unten
  • result:Byte

VGO_X

back to the index · zurück zum Index
Returns a byte that represents a weighted mix of an ink´s three color channels.
(Setting the weights to 1,1,1 is the same as 93,93,93 or $FF,$FF,$FF - important is only the relative balance of the values to each other! Therefore, 1,2,3 equals 2,4,6 and 15,30,45 and so on.)
  • oCol:__Ink = the source ink
  • oGs:Byte = the weight of the Green channel
  • oRs:Byte = the weight of the Red channel
  • oBs:Byte = the weight of the Blue channel
  • result:Byte
Gibt ein Byte zurück, das für eine gewichtete Mischung der drei Farbkanäle einer Ink steht.
(Die Wichtungen auf 1,1,1 zu setzen ist das gleiche wie 93,93,93 oder $FF,$FF,$FF - entscheidend ist allein das relative Verhältnis der Werte zueinander! Daher macht auch 1,2,3 das Gleiche wie 2,4,6 und 15,30,45 und so weiter.)
  • oCol:__Ink = die Quell-Ink
  • oGs:Byte = das Gewicht des grünen Kanals
  • oRs:Byte = das Gewicht des roten Kanals
  • oBs:Byte = das Gewicht des blauen Kanals
  • result:Byte
VGO_clear(lVGO,VGO_ink($000F));
VGO_screenCapture(lStamp,0,0,128,128);
VGO_Ink2GRBO(VGO_ink($FFF0),lGRBO);
For lx:= 0 to 127 do begin
  For ly:= 0 to 127 do begin
    // simple greyscale
    lGRBO.O := VGO_X(VGO_getPixel(lStamp,lx,ly),1,1,1);
    VGO_putPixel(lVGO,lx,ly,VGO_GRBO2Ink(lGRBO));
  End;
End;
VGO_clear(lVGO,VGO_ink($000F));
VGO_screenCapture(lStamp,0,0,128,128);
VGO_Ink2GRBO(VGO_ink($FFF0),lGRBO);
For lx:= 0 to 127 do begin
  For ly:= 0 to 127 do begin
    // physiological greyscale
    // the human eye sees green:red:blue by 6:3:1
    lGRBO.O := VGO_X(VGO_getPixel(lStamp,lx,ly),6,3,1);
    VGO_putPixel(lVGO,lx,ly,VGO_GRBO2Ink(lGRBO));
  End;
End;
VGO_clear(lVGO,VGO_ink($000F));
VGO_screenCapture(lStamp,0,0,128,128);
VGO_Ink2GRBO(VGO_ink($000F),lGRBO);
For lx:= 0 to 127 do begin
  For ly:= 0 to 127 do begin
    // Green channel
    lGRBO.G := VGO_X(VGO_getPixel(lStamp,lx,ly),1,0,0);
    VGO_putPixel(lVGO,lx,ly,VGO_GRBO2Ink(lGRBO));
  End;
End;
VGO_clear(lVGO,VGO_ink($000F));
VGO_screenCapture(lStamp,0,0,128,128);
VGO_Ink2GRBO(VGO_ink($000F),lGRBO);
For lx:= 0 to 127 do begin
  For ly:= 0 to 127 do begin
    // Red channel
    lGRBO.R := VGO_X(VGO_getPixel(lStamp,lx,ly),0,1,0);
    VGO_putPixel(lVGO,lx,ly,VGO_GRBO2Ink(lGRBO));
  End;
End;
VGO_clear(lVGO,VGO_ink($000F));
VGO_screenCapture(lStamp,0,0,128,128);
VGO_Ink2GRBO(VGO_ink($000F),lGRBO);
For lx:= 0 to 127 do begin
  For ly:= 0 to 127 do begin
    // Blue channel
    lGRBO.B := VGO_X(VGO_getPixel(lStamp,lx,ly),0,0,1);
    VGO_putPixel(lVGO,lx,ly,VGO_GRBO2Ink(lGRBO));
  End;
End;

VGO_S

back to the index · zurück zum Index
Returns the color saturation value (Byte) of an ink. $00 is totally greyscale (black, grey or white), $FF is a most vivid color.
  • oCol:__Ink = the source ink
  • result:Byte
Gibt den Farbsättigungswert einer Ink als Byte zurück. $00 ist völlig farblos (schwarz, grau oder weiß), knallbunte Farben ergeben $FF.
  • oCol:__Ink = die Quell-Ink
  • result:Byte
VGO_screenCapture(lVGO,0,0,pic.Width,pic.Height);
// here only for comparison
VGO_clear(lVGO,VGO_ink($000F));
VGO_screenCapture(lStamp,0,0,128,128);
VGO_Ink2GRBO(VGO_ink($FFF0),lGRBO);
For lx:= 0 to 127 do begin
  For ly:= 0 to 127 do begin
    lGRBO.O := VGO_S(VGO_getPixel(lStamp,lx,ly));
    VGO_putPixel(lVGO,lx,ly,VGO_GRBO2Ink(lGRBO));
  End;
End;

CopyGRBO

back to the index · zurück zum Index
This just copies a GRBO into another one.
  • oFrom:__GRBO = the source GRBO
  • var oTo:__GRBO = the destination GRBO
Dies kopiert lediglich einen GRBO in einen zweiten.
  • oFrom:__GRBO = der Quell-GRBO
  • var oTo:__GRBO = der Ziel-GRBO

VGO_blendInks

back to the index · zurück zum Index
This lets you mix two inks using a desired mixing ratio, to get a new ink out of it (as with a painter´s palette).
  • oInk1:__Ink = source ink 1
  • oInk2:__Ink = source ink 2
  • oMixer:Byte = mixing ratio
    • $00 = only ink 1
    • $40 = mainly ink 1
    • $80 = 50:50 mix
    • $C0 = mainly ink 2
    • $FF = only ink 2
  • result:__Ink
Hiermit kannst du zwei Inks in einem gewünschten Verhältnis zusammenmischen, um eine neue Ink zu erhalten (wie bei einer Malpalette).
  • oInk1:__Ink = Quell-Ink 1
  • oInk2:__Ink = Quell-Ink 2
  • oMixer:Byte = Mischverhältnis
    • $00 = nur Ink 1
    • $40 = überwiegend Ink 1
    • $80 = 50:50-Mix
    • $C0 = überwiegend Ink 2
    • $FF = nur Ink 2
  • result:__Ink

CopyRectA

back to the index · zurück zum Index
This just copies a RectA into another one.
  • oFrom:__RectA = the source RectA
  • var oTo:__RectA = the destination RectA
Dies kopiert lediglich ein RectA in ein zweites.
  • oFrom:__RectA = der Quell-RectA
  • var oTo:__RectA = der Ziel-RectA

InRectA

back to the index · zurück zum Index
This tests if a point lies within a rectangular area of interest, and returns the Boolean answer.
  • ox:Integer = the point´s horizontal offset to the right
  • oy:Integer = the point´s vertical offset down
  • oRectA:__RectA = the rectangular area
  • result:Boolean
Dies prüft, ob ein Punkt innerhalb eines bestimmten rechteckigen Bereichs liegt, und gibt die Antwort als Boolean zurück.
  • ox:Integer = des Punktes horizontaler Versatz nach rechts
  • oy:Integer = des Punktes vertikaler Versatz nach unten
  • oRectA:__RectA = der rechteckige Bereich
  • result:Boolean

ModifyRectA

back to the index · zurück zum Index
You can use this to modify a RectA.
  • var oRectA:__RectA = your RectA
  • oHShift:Integer = horizontal shift to the right
  • oVShift:Integer = vertical shift down
  • oHStretch:Integer = horizontal stretch (widening)
  • oVStretch:Integer = vertical stretch (increases the height)
The stretching will be performed such that the center remains still!
Dies kannst du verwenden, um ein RectA zu modifizieren.
  • var oRectA:__RectA = dein RectA
  • oHShift:Integer = horizontale Verschiebung nach rechts
  • oVShift:Integer = vertikale Verschiebung nach unten
  • oHStretch:Integer = horizontale Vergrößerung (Verbreiterung)
  • oVStretch:Integer = vertikale Vergrößerung (zum höher machen)
Die Vergrößerungen geschehen symmetrisch um die Mittelachse!
VGO_clear(lVGO,VGO_ink($000F));
lRectA := MakeRectA(30,20,70,80);
VGO_putBorder(lVGO,lRectA,1,VGO_ink($0F0F)); // red
// lift it up by 5 pixels
// and make it 30 pixels wider
ModifyRectA(lRectA,0,-5,30,0);
VGO_putBorder(lVGO,lRectA,1,VGO_ink($F00F)); // green

TrimRectAL

back to the index · zurück zum Index
Use this if you want to modify only the left side of a RectA, but keep the other three sides where they are.
  • var oRectA:__RectA = your RectA
  • oSize:Integer = how many pixels the side shall be moved inwards the rectangle (now guess what negative values will do)
Verwende dies, wenn du nur die linke Seite eines RectAs verändern willst, die anderen drei Seiten aber nicht.
  • var oRectA:__RectA = dein RectA
  • oSize:Integer = um soviele Pixel wird die Seite ins Rechteckinnere verschoben (und nun rate mal, was negative Werte bewirken)
VGO_clear(lVGO,VGO_ink($000F));
lRectA := MakeRectA(30,20,70,80);
VGO_putBorder(lVGO,lRectA,1,VGO_ink($0F0F)); // red
TrimRectAL(lRectA,20);
VGO_putBorder(lVGO,lRectA,1,VGO_ink($F00F)); // green
VGO_clear(lVGO,VGO_ink($000F));
lRectA := MakeRectA(30,20,70,80);
VGO_putBorder(lVGO,lRectA,1,VGO_ink($0F0F)); // red
TrimRectAL(lRectA,-20); // let´s just try it out...
// now I´m so curious! ;)
VGO_putBorder(lVGO,lRectA,1,VGO_ink($F00F)); // green
// >>> I guess your answer was correct. :)

TrimRectAR

back to the index · zurück zum Index
Use this if you want to modify only the right side of a RectA, but keep the other three sides where they are.
  • var oRectA:__RectA = your RectA
  • oSize:Integer = how many pixels the side shall be moved inwards the rectangle
Verwende dies, wenn du nur die rechte Seite eines RectAs verändern willst, die anderen drei Seiten aber nicht.
  • var oRectA:__RectA = dein RectA
  • oSize:Integer = um soviele Pixel wird die Seite ins Rechteckinnere verschoben
VGO_clear(lVGO,VGO_ink($000F));
lRectA := MakeRectA(30,20,70,80);
VGO_putBorder(lVGO,lRectA,1,VGO_ink($0F0F)); // red
TrimRectAR(lRectA,20);
VGO_putBorder(lVGO,lRectA,1,VGO_ink($F00F)); // green

TrimRectAT

back to the index · zurück zum Index
Use this if you want to modify only the top side of a RectA, but keep the other three sides where they are.
  • var oRectA:__RectA = your RectA
  • oSize:Integer = how many pixels the side shall be moved inwards the rectangle
Verwende dies, wenn du nur die obere Seite eines RectAs verändern willst, die anderen drei Seiten aber nicht.
  • var oRectA:__RectA = dein RectA
  • oSize:Integer = um soviele Pixel wird die Seite ins Rechteckinnere verschoben
VGO_clear(lVGO,VGO_ink($000F));
lRectA := MakeRectA(30,20,70,80);
VGO_putBorder(lVGO,lRectA,1,VGO_ink($0F0F)); // red
TrimRectAT(lRectA,20);
VGO_putBorder(lVGO,lRectA,1,VGO_ink($F00F)); // green

TrimRectAB

back to the index · zurück zum Index
Use this if you want to modify only the bottom side of a RectA, but keep the other three sides where they are.
  • var oRectA:__RectA = your RectA
  • oSize:Integer = how many pixels the side shall be moved inwards the rectangle
Verwende dies, wenn du nur die untere Seite eines RectAs verändern willst, die anderen drei Seiten aber nicht.
  • var oRectA:__RectA = dein RectA
  • oSize:Integer = um soviele Pixel wird die Seite ins Rechteckinnere verschoben
VGO_clear(lVGO,VGO_ink($000F));
lRectA := MakeRectA(30,20,70,80);
VGO_putBorder(lVGO,lRectA,1,VGO_ink($0F0F)); // red
TrimRectAB(lRectA,20);
VGO_putBorder(lVGO,lRectA,1,VGO_ink($F00F)); // green
Do you want to contact or support me?
(The link opens a new window.)
Möchtest du mich kontaktieren oder unterstützen?
(Der Link öffnet ein neues Fenster.)