From 1c025af420426e380c4a8ccd4bf076aeb54292cf Mon Sep 17 00:00:00 2001 From: Wizzup? Date: Thu, 17 Dec 2009 14:54:21 +0000 Subject: [PATCH] Check out MufasaTests for ocr filter v1 git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@282 3f818213-9676-44b0-a9b4-5e4c4e03d09d --- Projects/MufasaTests/project1.lpi | 251 ++++++++++++++++-------------- Projects/MufasaTests/project1.lpr | 133 +++++++++++----- Projects/SAMufasaGUI/project1.lpi | 240 ++++++++++++++-------------- Units/MMLCore/dtm.pas | 4 - Units/MMLCore/mufasatypes.pas | 5 + Units/MMLCore/window.pas | 15 +- 6 files changed, 362 insertions(+), 286 deletions(-) diff --git a/Projects/MufasaTests/project1.lpi b/Projects/MufasaTests/project1.lpi index 8f5b8e0..ed3117e 100644 --- a/Projects/MufasaTests/project1.lpi +++ b/Projects/MufasaTests/project1.lpi @@ -11,7 +11,7 @@ - + @@ -30,15 +30,15 @@ - + - - + + - + @@ -46,15 +46,15 @@ - + - - - - + + + + @@ -62,281 +62,302 @@ - + - - + + - - - + + + - - - - + + + + - - - - + + + + - + - - + + - - - - + + + + - + - + - - - + + + - - + + - + - + - + - + - + - - + + - - - + + + - - - + + + - - - + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/Projects/MufasaTests/project1.lpr b/Projects/MufasaTests/project1.lpr index da4d6bb..b81d131 100644 --- a/Projects/MufasaTests/project1.lpr +++ b/Projects/MufasaTests/project1.lpr @@ -10,7 +10,7 @@ uses Forms,Interfaces, LCLIntf, Client, - bitmaps,x ,mufasatypes,dtm,dtmutil, ocrutil + bitmaps,x ,mufasatypes,dtm,dtmutil, ocrutil ,graphics ,colour_conv,math { you can add units after this }; @@ -54,14 +54,21 @@ end; procedure MufasaTests.DoRun; +const + ocr_Limit_High = 192; + ocr_Limit_Low = 65; + var ErrorMsg: String; Time: DWord; C: TClient; - I: Integer; + I, w, h,x,y: Integer; dtm: pdtm; p:tpointarray; - bmp: TMufasaBitmap; + bmp, bmprs: TMufasaBitmap; + cyan, itemc:integer; + r,g,b:integer; + t:Dword; begin // quick check parameters @@ -80,53 +87,93 @@ begin end; { add your program here } + cyan := rgbtocolor(0,255,255); + + + bmprs := TMufasaBitmap.Create; + bmprs.LoadFromFile('/home/merlijn/Programs/mufasa/pics/uptext6.bmp'); C := TClient.Create; + C.MWindow.SetTarget(bmprs); + C.MWindow.GetDimensions(w, h); bmp := TMufasaBitmap.Create; - bmp.SetSize(CW,CH); - Writeln(Format('Client W/H: %d, %d', [CW, CH])); - FillChar(bmp.FData[0],sizeof(trgb32)*CW*CH, 0); - Randomize; - for i := 0 to 500 do - bmp.fastsetpixel(random(CW), random(CH), 255); - { bmp.FastSetPixel(8,8,255); - bmp.FastSetPixel(9,9,255); - bmp.FastSetPixel(7,7,255); - bmp.FastSetPixel(9,8,255); - bmp.FastSetPixel(8,9,255); } - C.MWindow.SetTarget(bmp); + bmp.CopyClientToBitmap(C.MWindow, True, 0, 0, 450, 50); + + t:=gettickcount; + + for y := 0 to bmp.Height - 1 do + for x := 0 to bmp.Width - 1 do + begin + colortorgb(bmp.fastgetpixel(x,y),r,g,b); + // the abs(g-b) < 15 seems to help heaps when taking out crap points + if (r > ocr_Limit_High) and (g > ocr_Limit_High) and (b > ocr_Limit_High) and (abs(g-b) < 15) then + begin + bmp.fastsetpixel(x,y,clwhite); + continue; + end; + if (r < ocr_Limit_Low) and (g > ocr_Limit_High) and (b > ocr_Limit_High) then + begin + bmp.fastsetpixel(x,y,cyan); + continue; + end; + if (r < ocr_Limit_Low) and (g > ocr_Limit_High) and (b < ocr_Limit_Low) then + begin + bmp.fastsetpixel(x,y,rgbtocolor(0,255,0)); + continue; + end; + if(r > ocr_Limit_High) and (g > 100) and (g < ocr_Limit_High) and (b > 30) and (b < 90) then + begin + bmp.fastsetpixel(x,y,rgbtocolor(255,127,0)); + continue; + end; + if(r > ocr_Limit_High) and (g > ocr_Limit_High) and (b < ocr_Limit_Low) then + begin + bmp.fastsetpixel(x,y,rgbtocolor(255,255,0)); + continue; + end; + // better use g < 40 than ocr_Limit_Low imo + if (r > ocr_Limit_High) and (g < ocr_Limit_Low) and (b < ocr_Limit_Low) then + begin + bmp.fastsetpixel(x,y,rgbtocolor(255,0,0)); + continue; + end; + + bmp.fastsetpixel(x,y,0); + end; + writeln(inttostr(gettickcount-t)); + { + bmp.Posterize(130); // ~ 3 + // bmp.Contrast(3); + + for y := 0 to bmp.Height - 1 do + for x := 0 to bmp.Width - 1 do + begin + if bmp.FastGetPixel(x, y) = clWhite then + continue; + //cyan + if bmp.FastGetPixel(x, y) = rgbtocolor(0,255,255) then + continue; + //green + if bmp.FastGetPixel(x, y) = rgbtocolor(0,255,0) then + continue; + + //item // TODO -> 5.bmp = not OK + if bmp.FastGetPixel(x, y) = rgbtocolor(255,130,0) then + continue; + + //yellow, interact + if bmp.FastGetPixel(x, y) = rgbtocolor(255,255,0) then + continue; + + bmp.fastsetpixel(x,y,0); + end; + } - { initdtm(dtm, 5); - dtm.p[0] := Point(2, 2); - dtm.p[1] := Point(-3, -3); - dtm.p[2] := Point(0, 0); - dtm.p[3] := Point(1, 1); - dtm.p[4] := Point(3, 3); - dtm.c[0] := 255; - dtm.t[0] := 0; - dtm.asz[1] := 1; - dtm.ash[1] := dtm_Rectangle; } - - dtm := randomdtm(20); - - // setlength(p, 1); - time := GetTickCount; - C.MFinder.FindDTMs(dtm, p, 0, 0,CW-1, CH-1, 0); - writeln(inttostr(gettickcount - time) + 'ms'); - setlength(p,0); - - time := GetTickCount; - C.MFinder.FindDTMs(dtm, p, 0, 0,CW-1, CH-1, 0); - //C.MFinder.FindDTM(dtm, p[0].x, p[0].y, 0, 0,CW-1, CH-1); - writeln(inttostr(gettickcount - time) + 'ms'); - writeln(inttostr(length(p))+ ' points found'); - - {for i := 0 to high(p) do - writeln(format('%d: (%d, %d)', [i, p[i].x, p[i].y])); } - //bmp.OnDestroy:=nil; + bmp.SaveToFile('/tmp/output.bmp'); + //bmp.OnDestroy:=nil; bmp.Free; C.Free; diff --git a/Projects/SAMufasaGUI/project1.lpi b/Projects/SAMufasaGUI/project1.lpi index d9f60ba..2760317 100644 --- a/Projects/SAMufasaGUI/project1.lpi +++ b/Projects/SAMufasaGUI/project1.lpi @@ -10,7 +10,7 @@ <UseXPManifest Value="True"/> - <ActiveEditorIndexAtStart Value="5"/> + <ActiveEditorIndexAtStart Value="11"/> </General> <VersionInfo> <ProjectVersion Value=""/> @@ -42,7 +42,7 @@ <IsPartOfProject Value="True"/> <UnitName Value="project1"/> <CursorPos X="100" Y="21"/> - <TopLine Value="19"/> + <TopLine Value="6"/> <EditorIndex Value="10"/> <UsageCount Value="205"/> <Loaded Value="True"/> @@ -259,8 +259,8 @@ <Filename Value="../../Units/MMLCore/window.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="Window"/> - <CursorPos X="32" Y="6"/> - <TopLine Value="1"/> + <CursorPos X="59" Y="635"/> + <TopLine Value="605"/> <EditorIndex Value="3"/> <UsageCount Value="201"/> <Loaded Value="True"/> @@ -278,7 +278,7 @@ <CursorPos X="23" Y="8"/> <TopLine Value="1"/> <EditorIndex Value="14"/> - <UsageCount Value="59"/> + <UsageCount Value="61"/> <Loaded Value="True"/> </Unit31> <Unit32> @@ -292,8 +292,8 @@ <Filename Value="../../Units/MMLCore/finder.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="finder"/> - <CursorPos X="97" Y="1681"/> - <TopLine Value="1666"/> + <CursorPos X="75" Y="1710"/> + <TopLine Value="1653"/> <EditorIndex Value="7"/> <UsageCount Value="201"/> <Loaded Value="True"/> @@ -386,7 +386,7 @@ <Unit46> <Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/> <CursorPos X="117" Y="32"/> - <TopLine Value="22"/> + <TopLine Value="4"/> <EditorIndex Value="12"/> <UsageCount Value="100"/> <Loaded Value="True"/> @@ -407,8 +407,8 @@ <Filename Value="../../Units/MMLCore/bitmaps.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="bitmaps"/> - <CursorPos X="6" Y="611"/> - <TopLine Value="598"/> + <CursorPos X="70" Y="896"/> + <TopLine Value="882"/> <EditorIndex Value="2"/> <UsageCount Value="200"/> <Loaded Value="True"/> @@ -712,8 +712,8 @@ <Filename Value="../../Units/MMLCore/dtm.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="dtm"/> - <CursorPos X="112" Y="86"/> - <TopLine Value="1"/> + <CursorPos X="7" Y="139"/> + <TopLine Value="109"/> <EditorIndex Value="11"/> <UsageCount Value="200"/> <Loaded Value="True"/> @@ -729,8 +729,8 @@ <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="colourpicker"/> - <CursorPos X="1" Y="148"/> - <TopLine Value="1"/> + <CursorPos X="65" Y="243"/> + <TopLine Value="86"/> <EditorIndex Value="8"/> <UsageCount Value="201"/> <Loaded Value="True"/> @@ -808,7 +808,7 @@ <CursorPos X="33" Y="34"/> <TopLine Value="30"/> <EditorIndex Value="13"/> - <UsageCount Value="18"/> + <UsageCount Value="20"/> <Loaded Value="True"/> </Unit107> <Unit108> @@ -1002,7 +1002,7 @@ <UnitName Value="web"/> <CursorPos X="1" Y="1"/> <TopLine Value="1"/> - <UsageCount Value="163"/> + <UsageCount Value="167"/> </Unit136> <Unit137> <Filename Value="../../../lazarus/lcl/lazhelphtml.pas"/> @@ -1201,7 +1201,7 @@ <UnitName Value="framescript"/> <CursorPos X="106" Y="190"/> <TopLine Value="180"/> - <UsageCount Value="156"/> + <UsageCount Value="160"/> </Unit161> <Unit162> <Filename Value="framesynedit.lrs"/> @@ -1513,10 +1513,10 @@ <ComponentName Value="ColourHistoryForm"/> <ResourceBaseClass Value="Form"/> <UnitName Value="colourhistory"/> - <CursorPos X="45" Y="141"/> - <TopLine Value="115"/> + <CursorPos X="36" Y="135"/> + <TopLine Value="13"/> <EditorIndex Value="5"/> - <UsageCount Value="93"/> + <UsageCount Value="97"/> <Loaded Value="True"/> </Unit208> <Unit209> @@ -1767,7 +1767,7 @@ <UnitName Value="about"/> <CursorPos X="44" Y="21"/> <TopLine Value="4"/> - <UsageCount Value="56"/> + <UsageCount Value="60"/> </Unit245> <Unit246> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/file.inc"/> @@ -1781,7 +1781,7 @@ <UnitName Value="internets"/> <CursorPos X="87" Y="3"/> <TopLine Value="1"/> - <UsageCount Value="50"/> + <UsageCount Value="54"/> </Unit247> <Unit248> <Filename Value="debugimageform.pas"/> @@ -1790,7 +1790,7 @@ <UnitName Value="debugimageform"/> <CursorPos X="20" Y="1"/> <TopLine Value="1"/> - <UsageCount Value="37"/> + <UsageCount Value="41"/> </Unit248> <Unit249> <Filename Value="debugimage.pas"/> @@ -1800,9 +1800,9 @@ <UnitName Value="debugimage"/> <ComponentState Value="1"/> <CursorPos X="62" Y="62"/> - <TopLine Value="54"/> + <TopLine Value="1"/> <EditorIndex Value="6"/> - <UsageCount Value="36"/> + <UsageCount Value="40"/> <Loaded Value="True"/> </Unit249> <Unit250> @@ -1872,123 +1872,127 @@ <SyntaxHighlighter Value="XML"/> </Unit259> </Units> - <JumpHistory Count="29" HistoryIndex="28"> + <JumpHistory Count="30" HistoryIndex="29"> <Position1> - <Filename Value="../../Units/MMLCore/finder.pas"/> - <Caret Line="1616" Column="14" TopLine="1601"/> + <Filename Value="debugimage.pas"/> + <Caret Line="115" Column="99" TopLine="94"/> </Position1> <Position2> - <Filename Value="../../Units/MMLCore/finder.pas"/> - <Caret Line="104" Column="31" TopLine="89"/> + <Filename Value="testunit.pas"/> + <Caret Line="1053" Column="33" TopLine="1049"/> </Position2> <Position3> - <Filename Value="../../Units/MMLCore/finder.pas"/> - <Caret Line="1681" Column="96" TopLine="1662"/> + <Filename Value="debugimage.pas"/> + <Caret Line="81" Column="35" TopLine="78"/> </Position3> <Position4> - <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> - <Caret Line="137" Column="23" TopLine="121"/> + <Filename Value="debugimage.pas"/> + <Caret Line="71" Column="47" TopLine="59"/> </Position4> <Position5> <Filename Value="testunit.pas"/> - <Caret Line="40" Column="51" TopLine="40"/> + <Caret Line="1052" Column="53" TopLine="1049"/> </Position5> <Position6> <Filename Value="testunit.pas"/> - <Caret Line="45" Column="51" TopLine="1"/> + <Caret Line="993" Column="49" TopLine="736"/> </Position6> <Position7> <Filename Value="testunit.pas"/> - <Caret Line="379" Column="26" TopLine="359"/> + <Caret Line="817" Column="39" TopLine="23"/> </Position7> <Position8> <Filename Value="testunit.pas"/> - <Caret Line="362" Column="32" TopLine="359"/> + <Caret Line="24" Column="53" TopLine="1"/> </Position8> <Position9> - <Filename Value="testunit.pas"/> - <Caret Line="1311" Column="57" TopLine="1291"/> - </Position9> - <Position10> - <Filename Value="testunit.pas"/> - <Caret Line="1316" Column="57" TopLine="1291"/> - </Position10> - <Position11> - <Filename Value="testunit.pas"/> - <Caret Line="10" Column="75" TopLine="1"/> - </Position11> - <Position12> - <Filename Value="testunit.pas"/> - <Caret Line="1311" Column="65" TopLine="1291"/> - </Position12> - <Position13> - <Filename Value="testunit.pas"/> - <Caret Line="8" Column="103" TopLine="3"/> - </Position13> - <Position14> - <Filename Value="testunit.pas"/> - <Caret Line="180" Column="25" TopLine="160"/> - </Position14> - <Position15> - <Filename Value="testunit.pas"/> - <Caret Line="1311" Column="57" TopLine="1291"/> - </Position15> - <Position16> - <Filename Value="testunit.pas"/> - <Caret Line="10" Column="108" TopLine="1"/> - </Position16> - <Position17> - <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> - <Caret Line="104" Column="73" TopLine="73"/> - </Position17> - <Position18> - <Filename Value="testunit.pas"/> - <Caret Line="165" Column="119" TopLine="160"/> - </Position18> - <Position19> - <Filename Value="project1.lpr"/> - <Caret Line="38" Column="79" TopLine="5"/> - </Position19> - <Position20> - <Filename Value="testunit.pas"/> - <Caret Line="1129" Column="75" TopLine="1105"/> - </Position20> - <Position21> - <Filename Value="debugimage.pas"/> - <Caret Line="115" Column="99" TopLine="94"/> - </Position21> - <Position22> - <Filename Value="testunit.pas"/> - <Caret Line="1053" Column="33" TopLine="1049"/> - </Position22> - <Position23> - <Filename Value="debugimage.pas"/> - <Caret Line="81" Column="35" TopLine="78"/> - </Position23> - <Position24> - <Filename Value="debugimage.pas"/> - <Caret Line="71" Column="47" TopLine="59"/> - </Position24> - <Position25> - <Filename Value="testunit.pas"/> - <Caret Line="1052" Column="53" TopLine="1049"/> - </Position25> - <Position26> - <Filename Value="testunit.pas"/> - <Caret Line="993" Column="49" TopLine="736"/> - </Position26> - <Position27> - <Filename Value="testunit.pas"/> - <Caret Line="817" Column="39" TopLine="23"/> - </Position27> - <Position28> - <Filename Value="testunit.pas"/> - <Caret Line="24" Column="53" TopLine="1"/> - </Position28> - <Position29> <Filename Value="colourhistory.pas"/> <Caret Line="7" Column="88" TopLine="1"/> + </Position9> + <Position10> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="162" Column="14" TopLine="132"/> + </Position10> + <Position11> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="47" Column="69" TopLine="36"/> + </Position11> + <Position12> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="51" Column="33" TopLine="36"/> + </Position12> + <Position13> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="153" Column="37" TopLine="133"/> + </Position13> + <Position14> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="111" Column="51" TopLine="92"/> + </Position14> + <Position15> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="180" Column="19" TopLine="160"/> + </Position15> + <Position16> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="182" Column="30" TopLine="160"/> + </Position16> + <Position17> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="179" Column="65" TopLine="152"/> + </Position17> + <Position18> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="180" Column="9" TopLine="152"/> + </Position18> + <Position19> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="182" Column="25" TopLine="152"/> + </Position19> + <Position20> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="183" Column="8" TopLine="152"/> + </Position20> + <Position21> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="184" Column="8" TopLine="152"/> + </Position21> + <Position22> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="202" Column="10" TopLine="182"/> + </Position22> + <Position23> + <Filename Value="../../Units/MMLAddon/colourpicker.pas"/> + <Caret Line="240" Column="10" TopLine="220"/> + </Position23> + <Position24> + <Filename Value="../../Units/MMLCore/bitmaps.pas"/> + <Caret Line="376" Column="10" TopLine="358"/> + </Position24> + <Position25> + <Filename Value="../../Units/MMLCore/bitmaps.pas"/> + <Caret Line="49" Column="28" TopLine="29"/> + </Position25> + <Position26> + <Filename Value="../../Units/MMLCore/bitmaps.pas"/> + <Caret Line="376" Column="16" TopLine="356"/> + </Position26> + <Position27> + <Filename Value="../../Units/MMLCore/bitmaps.pas"/> + <Caret Line="389" Column="18" TopLine="356"/> + </Position27> + <Position28> + <Filename Value="../../Units/MMLCore/bitmaps.pas"/> + <Caret Line="396" Column="16" TopLine="376"/> + </Position28> + <Position29> + <Filename Value="../../Units/MMLCore/bitmaps.pas"/> + <Caret Line="408" Column="18" TopLine="376"/> </Position29> + <Position30> + <Filename Value="../../Units/MMLCore/bitmaps.pas"/> + <Caret Line="448" Column="16" TopLine="428"/> + </Position30> </JumpHistory> </ProjectOptions> <CompilerOptions> diff --git a/Units/MMLCore/dtm.pas b/Units/MMLCore/dtm.pas index c57d666..9c5e8dd 100644 --- a/Units/MMLCore/dtm.pas +++ b/Units/MMLCore/dtm.pas @@ -121,13 +121,10 @@ end; {$DEFINE DTM_DEBUG} destructor TMDTM.Destroy; -{$IFDEF DTM_DEBUG} var i, j: integer; b:boolean; -{$ENDIF} begin - {$IFDEF DTM_DEBUG} for i := 0 to high(DTMList) do begin b := false; @@ -140,7 +137,6 @@ begin if not b then writeln('DTM Number ' + inttostr(i) + ' was not freed'); end; - {$ENDIF} SetLength(DTMList, 0); SetLength(FreeSpots, 0); SetLength(BufferString, 0); diff --git a/Units/MMLCore/mufasatypes.pas b/Units/MMLCore/mufasatypes.pas index abc7056..80d468d 100644 --- a/Units/MMLCore/mufasatypes.pas +++ b/Units/MMLCore/mufasatypes.pas @@ -89,6 +89,11 @@ type { TODO: add cts per colour/tolerance? } // TODO DTM-Not points. Not very hard really. + + { not points - + add seperate tpa or boolean array for every point that is to be matched ? + } + pDTM = record l: Integer; p: TPointArray; diff --git a/Units/MMLCore/window.pas b/Units/MMLCore/window.pas index 81c3a0d..454e33e 100644 --- a/Units/MMLCore/window.pas +++ b/Units/MMLCore/window.pas @@ -432,10 +432,7 @@ begin Self.FreezeState:=False; end; -// Bugged. For params other than 0, 0, ClientWidth, ClientHeight -// if other type than w_XImage - -// Also possibly thread bugged +//Remove? function TMWindow.CopyClientToBitmap(xs, ys, xe, ye: integer): TBitmap; var w,h: Integer; @@ -518,6 +515,8 @@ begin end; end; +// Set's input focus on Linux, does not mean the window will look `active', but +// it surely is. Try typing something after ActivateClient. procedure TMWindow.ActivateClient; {$IFDEF LINUX} var @@ -539,7 +538,7 @@ begin {$ENDIF} end; -{$IFDEF MSWINDOWS} //Probably need one for Linux as well +{$IFDEF MSWINDOWS} function TMWindow.UpdateDrawBitmap :boolean; var w,h : integer; @@ -555,6 +554,7 @@ begin end; {$ENDIF} +// Returns dimensions of the Window procedure TMWindow.GetDimensions(out W, H: Integer); {$IFDEF LINUX} var @@ -616,6 +616,7 @@ begin end; end; +// Make this use GetDimensions, ray...? function TMWindow.GetDimensionBox(out Box : TBox) : boolean; function IntToTBox(x1,y1,x2,y2 : integer) : TBox;inline; begin; @@ -668,6 +669,7 @@ begin end; end; +// Set target to X-Window {$IFDEF LINUX} function TMWindow.SetTarget(XWindow: x.TWindow): integer; overload; var @@ -682,6 +684,7 @@ begin end; {$ENDIF} +// Set target to Windows Window function TMWindow.SetTarget(Window: THandle; NewType: TTargetWindowMode): integer; overload; begin if Self.Frozen then @@ -735,9 +738,9 @@ begin {$IFDEF WINDOWS} Self.TargetHandle:= windows.GetDesktopWindow; {$ENDIF} - end; +// Set target to Bitmap function TMWindow.SetTarget(Bitmap: TMufasaBitmap): integer; begin if Self.Frozen then