Вообще-то принято проверять, велик-ли выигрыш от применения каких-либо компонентов, свойств, изменений и стоит-ли овчинка выделки Вот:
Сравним в микросекундах
Add(MainForm,13059791,119,70) { Width=668 Height=316 Position=1 Point(Handle) Point(PHandle) } Add(FTCG_Tools,5160442,329,140) { link(onEvent,2646048:doEvent1,[]) link(Data,7483374:Var3,[(335,117)]) } BEGIN_SDK Add(EditMultiEx,5722645,70,35) { WorkCount=#7:doWork1| EventCount=#7:onEvent| DataCount=#4:Data| Width=398 Height=186 link(doWork1,14752783:doValue,[(80,41)(80,69)]) } Add(FT_Img_Point,2379337,196,140) { DrawSource=2 X=10 Y=10 Color=255 link(Bitmap,14752783:Value,[(202,118)(111,118)]) link(X,11233175:Position,[(209,107)(160,107)]) link(Y,7108345:Position,[(216,118)(251,118)]) link(Color,1362049:Result,[(223,124)(349,124)]) } Add(FT_For,11233175,154,63) { End=200 Start=1 link(onEvent,5074214:doValue,[]) link(onStop,5722645:onEvent,[(195,76)(195,41)]) } Add(FT_Memory,14752783,105,63) { link(onData,11233175:doFor,[]) } Add(FT_For,7108345,245,63) { End=200 Start=1 link(onEvent,5496237:doOperation,[]) } Add(FT_Memory,5074214,203,63) { link(onData,7108345:doFor,[]) } Add(FT_Math,5496237,287,63) { OpType=2 ResultType=0 link(onResult,1362049:doOperation,[]) link(Op1,5074214:Value,[(293,51)(240,51)(240,100)(209,100)]) } Add(FT_Math,1362049,343,63) { OpType=2 ResultType=0 link(onResult,2379337:doDraw,[(386,69)(386,129)(184,129)(184,146)]) link(Op1,5496237:Result,[(349,51)(327,51)(327,107)(293,107)]) link(Op2,5722645:Data,[(356,44)(76,44)]) } END_SDK Add(PaintBox,16017229,280,133) { Left=10 Top=40 Width=200 Height=200 Point(PHandle) Point(onPaint) link(onPaint,5160442:doWork1,[]) } Add(Hub,6980997,245,119) { link(onEvent1,15901257:doStart,[]) link(onEvent2,16017229:doRefresh,[(270,132)(270,139)]) } Add(TimeCounter,15901257,434,119) { Precision=1 link(onStop,4412990:doText,[]) } Add(Image,1975653,371,217) { Left=235 Top=40 Width=200 Height=200 link(Bitmap,154270:Var1,[(377,208)(363,208)(363,250)(293,250)]) } Add(Label,4412990,483,126) { Left=75 Top=245 } Add(Label,10572780,476,196) { Left=305 Top=250 } Add(TimeCounter,6210471,434,189) { Precision=1 link(onStop,10572780:doText,[]) } Add(MultiElement,154270,287,210) { link(onEvent1,14662443:doEvent1,[(347,216)(347,202)(277,202)(277,223)]) link(Data1,14047545:Var3,[(293,187)]) } BEGIN_SDK Add(EditMulti,13544178,21,21) { EventCount=1 WorkCount=1 DataCount=1 VarCount=1 Width=370 Height=151 VOffset=42 HOffset=217 link(doWork1,15710639:doEvent1,[]) link(Var1,579319:Var2,[(244,131)(349,131)]) } Add(Bitmap,10696943,343,63) { HWidth=200 HHeight=200 Point(doCreate) } Add(Img_Point,3746056,287,70) { Point(X) Point(Y) Point(Color) link(Bitmap,579319:Var1,[(293,61)(335,61)(335,103)]) link(X,11512919:Var3,[(300,55)]) link(Y,11877713:Position,[(307,47)(279,47)(279,117)(139,117)]) link(Color,10361197:Result,[(314,40)(272,40)(272,110)(237,110)]) } Add(Math,10654584,182,70) { OpType=2 ResultType=0 link(onResult,10361197:doOperation,[]) link(Op2,11512919:Var2,[]) } Add(Math,10361197,231,70) { OpType=2 ResultType=0 link(onResult,3746056:doDraw,[]) link(Op2,13544178:Data1,[]) } Add(For,15663117,77,70) { End=199 link(onEvent,11877713:doFor,[]) link(onStop,13544178:onEvent1,[(116,83)(116,34)(382,34)(382,69)]) } Add(For,11877713,133,70) { End=199 link(onEvent,10654584:doOperation,[]) } Add(GetDataEx,11512919,189,50) { Angle=3 link(Data,15663117:Position,[(125,55)(125,110)(83,110)]) } Add(GetDataEx,579319,343,98) { link(Data,10696943:Bitmap,[]) } Add(Hub,15710639,42,63) { link(onEvent1,10696943:doCreate,[(67,69)(67,125)(326,125)(326,83)]) link(onEvent2,15663117:doFor,[]) } END_SDK Add(Hub,28926,245,189) { link(onEvent1,6210471:doStart,[]) link(onEvent2,154270:doWork1,[(270,202)(270,216)]) } Add(Hub,14662443,329,217) { OutCount=3 link(onEvent1,1975653:doLoad,[]) link(onEvent2,6210471:doStop,[(354,230)(354,202)]) link(onEvent3,8591560:doTimer,[(354,237)(354,258)(207,258)(207,286)]) } Add(InlineCode,13307373,301,287) { WorkPoints=#14:doCalc=Считать| EventPoints=#8:onResult|7:onError| VarPoints=#40:Result=Содержит преобразованную картинку| DataPoints=#16:Koef=Коеффициент| Code=#15:unit HiAsmUnit;|0:|9:interface|0:|29:uses Windows,kol,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|4: |9: public|25: _data_Data:THI_Event;|38: Koef:THI_Event; //Коеффициент|23: onResult:THI_Event;|22: onError:THI_Event;|0:|50: procedure doCalc(var _Data:TData; Index:word);|6: end;|14:implementation|0:|29:procedure THiAsmClass.doCalc;|33:type TLine = array[0..0]of byte;|21: PLine = ^TLine;|19:var bmp: PBitmap;|18: LineW:PLine;|32: i, j, k, Kf,Coll: integer;|23: RR, GG, BB: byte;|5:begin|35: Kf:=ReadInteger(_Data,Koef,127);|29: bmp := NewBitmap(200,200);|30: bmp.PixelFormat := pf24bit;|24: for i := 0 to 199 do|10: begin|31: LineW := bmp.ScanLine[i];|26: for j:= 0 to 199 do |12: begin|19: k := j * 3;|15: Coll:=i*j*Kf;|24: RR:=Coll mod 256; |24: LineW^[k+2]:=RR;|21: BB:=Coll div 65536;|16: LineW^[k]:=BB;|33: GG:=(Coll-BB*65536-RR) div 256;|18: LineW^[k+1]:=GG;|11: end;|10: end; |30: _hi_OnEvent(onResult, bmp);|12: bmp.free;|5: end;|3: |5:end. | link(onResult,5966128:doEvent1,[]) link(Koef,14047545:Var2,[(307,264)(174,264)]) } Add(Image,12782755,378,287) { Left=445 Top=40 Width=200 Height=200 Color=12639424 ViewStyle=4 } Add(Label,5712231,476,273) { Left=525 Top=250 } Add(Hub,5966128,343,287) { link(onEvent1,12782755:doLoad,[]) link(onEvent2,13699310:doStop,[(368,300)(368,279)]) } Add(Hub,9038832,266,280) { link(onEvent1,13699310:doStart,[(291,286)(291,272)]) link(onEvent2,13307373:doCalc,[]) } Add(TimeCounter,13699310,427,266) { Precision=1 link(onStop,5712231:doText,[]) } Add(ScrollBar,13807954,168,70) { Left=15 Top=10 Width=210 Max=20 Min=1 Page=1 Position=6 ScrollMode=1 link(onPosition,6980997:doEvent1,[(228,76)(228,125)]) } Add(GetDataEx,14047545,168,182) { link(Data,7483374:Var2,[]) } Add(Hub,2646048,371,140) { link(onEvent1,15901257:doStop,[(403,146)(403,132)]) link(onEvent2,14664871:doTimer,[(396,153)(396,181)(193,181)(193,195)]) } Add(GetDataEx,7483374,168,112) { link(Data,13807954:Position,[]) } Add(Timer,14664871,203,189) { Interval=10 Enable=1 AutoStop=1 link(onTimer,28926:doEvent1,[]) } Add(Timer,8591560,217,280) { Interval=10 Enable=1 AutoStop=1 link(onTimer,9038832:doEvent1,[]) }
|