<< Click to Display Table of Contents >> Navigation: 3. Script Language > Image/Pixel-Color Operations > ANA. - Imageworks > Paint Operations > Image/Pixel-Color Operations |
MiniRobotLanguage (MRL)
ANA.PatternFillHwn
Copy multiple equal Patterns into an Image-Register (IR) using a Windowhandle as Referenz for the Size of the Target.
Intention
This command will fill an IR with the Pattern from a smaller IR. It will use a Windowhandle in P4 as a Reference for the Target-Site.
The Target IR will be new created.
1. Fill an IR with a Pattern
You need to have an IR already, otherwise create one using the ANA.New Command.
Then Load the Pattern and start the Filling.
STW.ct|Chrome_WidgetWin_1|- Brave
HTV.$$HWN
ANA.Load|0|Heart.bmp
ANA.pafh|0|1|&HFFFFFF|$$HWN
ANA.Show|1!
ENR.
Using this Pattern, we get the result below.
On the TOS you will find the number of copied Patterns, in this case its 625.
Syntax
ANA.PatternFillHwn[|P1][|P2][|P3][|P4][|P5]
Parameter Explanation
P1 - opt. Source Image-Register number, if omitted, IR 0 will be used.
P2 - opt. Destination Image-Register number, if omitted, IR 0 will be used.
P3 - opt. Color for Background
P4 - Window-Handle
The Command will leave a 0 on the TOS in case of error, otherwise you get the number of copied patterns.
Example
'***********************************
' ANA.PatternFillHwn-Sample
' In this Sample we use a recorded 8x8 Pattern, that is filled into an IR
' and the blitted over a Picture. With the right "Shift" it will turn any a fitting Pattern into a black square.
'***********************************
' Load Picture
ANA.Load|1|TP8b.bmp
ANA.Mask|1
ANA.rcd|1|&H0|&H000101
' Load Fullpic to 0
ANA.Load|0|Soz_100.png
ANA.Mask|0
ANA.rcd|0|&H0|&H000101
ANA.copy|0|2
ANA.Show|0
STW.ct|Powergraph|debug
HTV.$$MYW
ANA.patternfillHwn|1|0|&HF0F0F0|$$MYW
' 0 ist nun das Multipattern
ANA.copy|2|1
VAN.$$LOY=0
VAN.$$LOX=2
ANA.show|0!
ANA.show|1!
ANA.bsh|0|1|$$LOX|$$LOY|7
ANA.show|1
' Find black pattern
ANA.scc|1|&H0|8|0
MMV.
MBX.!
ENR.
' Here you can see a typical operation.
Picture 1: This is the recorded Pattern Picture 2 This is the Fake-Site where we recorded the pattern As a result of the Blit-Operation, the place where the pattern fits turns into a black Square.
As a result of the Blit-Operation with Blit-Mode 7, the place where the pattern fits turns black, see the black square in the Middle.
Remarks
Plotting 93750 Copies of a Pattern on a 8000x6000 IR will take on my Computer 2498738 Ticks. That around 0.1 Seconds.
Limitations:
While the Aspect-Ration of he window will be equal with the Result, the total size may differ depending on the local settings.
This Command was used during the development, maybe its not of much use in the final version.
See also:
•