-
Notifications
You must be signed in to change notification settings - Fork 10
/
298_bitblt_animation3.txt
605 lines (548 loc) · 21.8 KB
/
298_bitblt_animation3.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
{***************************************************************
* Project : System Graphic Function Overview
* App Name : 298_bitblt_animation3, #locs=3293
* Purpose : Demonstrates bitmap manipulation - bitmapulation
* Date : 09/12/2012 - 17:07
* History : convert bitblt API to maXbox Nov 2011
* : system save demo for mX3.9.2, finished yet!!
: animates a self visible autocorrelation with motion control
: #sign:Max: MAXBOX10: 19/09/2016 16:53:05
****************************************************************}
Program BitBlt_Animation3;
{@BOOL WINAPI MessageBeep(
__in UINT uType );}
//TThreadFunction = function(P: Pointer): Longint; stdcall;
//Procedure ExecuteThread(afunc: TThreadFunction; var thrOK: boolean);
Const MILLISECONDS = 100;
function MessageBoxTimeOut(hWnd: HWND; lpText: PChar; lpCaption: PChar; uType: UINT;
wLanguageId: WORD; dwMilliseconds: DWORD): Integer;
external '[email protected] stdcall';
procedure CloseClick(Sender: TObject; var action: TCloseAction); forward;
Const
BACKMAP = 'examples\citymax.bmp';
BITMAP1 = 'examples\bmp48.bmp';
BITMAP2 = 'examples\bmp47.bmp';
//BITMAP1 = 'examples\images\bmp21.bmp'; //try another combinations
//BITMAP2 = 'examples\images\bmp29.bmp';
//BITMAP2 = 'examples\images\bmp33.bmp';
SAVEPATH = 'examples\bitdream298_3.png';
type
TByteArr = array of byte;
var
except_state, execute_state: string;
mytimestamp: TDateTime;
osType: TIdWin32Type;
bfrm: TForm;
FMask, FPic, FStorage: TBitMap;
FNewRect: TRect;
FOldRect: tRect; //make foldrect local!
FirstTime: boolean;
mT: TTimer;
procedure getMaxBoxIni;
var Ini: TIniFile;
begin
Ini:= TIniFile.Create(ExePath+'maxboxdef.ini');
try
except_state:= Ini.ReadString('Form', 'EXCEPTIONLOG','');
execute_state:= Ini.ReadString('Form', 'EXECUTESHELL','');
finally
writeln('inifile sysdata test: '+(except_state)+ ' '+(execute_state))
ini.Free;
end;
end;
procedure FormDrawBitmap(const fname: String; const x,y: Integer; acanvas: TCanvas);
var aBmp: TBitmap;
begin
if not FileExists(Fname) then begin
ShowMessage('The big bitmap ' + Fname + ' was not found!');
Exit;
end;
aBmp:= TBitmap.Create;
try
aBmp.LoadFromFile(Fname);
//aCanvas.Draw(x,y, aBmp);
aCanvas.StretchDraw(Rect(0,0,bfrm.width, bfrm.height), aBmp);
finally
aBmp.Free;
end;
end;
procedure BitmapFormCreate(Sender: TObject);
begin
FMask:= TBitMap.Create;
FMask.LoadFromFile(exepath+BITMAP2);
//FMask.LoadFromFile(exepath+'examples\citymax.bmp');
FPic:= TBitMap.Create;
FPic.LoadFromFile(exepath+BITMAP1);
//FPic.LoadFromFile(exepath+'examples\citymax.bmp');
//FPic.LoadFromFile(exepath+'examples\images\bmp47.bmp');
FStorage:= TBitMap.Create;
FStorage.Width:= FPic.Width;
FStorage.Height:= FPic.Height;
Screen.Cursor:= crNone;
end;
procedure TPlayGroundForm_UpdateImage;
var
DestImg: TBitmap;
t: Double;
x: Int64;
y: Integer;
CenterX, CenterY: Integer;
begin
// paint first on the buffer
// paint background in a zoom overview!
//BufferImg.Canvas.CopyRect(Rect(0,0,BufferImg.Width,BufferImg.Height),
// BackgroundImg.Canvas,Rect(0,0,BackgroundImg.Width,BackgroundImg.Height));
bfrm.Canvas.CopyRect(Rect(0,0,FStorage.Width,FStorage.Height),
bfrm.Canvas,Rect(0,0,bfrm.Width,bfrm.Height));
// paint sprite
CenterX:= bfrm.Width div 2;
CenterY:= bfrm.Height div 2;
t:= Now*86400;
x:= CenterX+round(cos(t)*CenterX*2/3)-(FPic.Width div 2);
y:= CenterY+round(sin(t*0.7)*CenterY*2/3)-(FPic.Height div 2);
//BufferImg.Canvas.Draw(x, y, SpriteImg);
bfrm.Canvas.Draw(x, y, FPic);
// copy to image
//FMask:= FStorage;
FMask.Width:=bfrm.Width;
FMask.Height:=bfrm.Height;
//DestImg.Canvas.Draw(0,0,BufferImg);
FMask.Canvas.Draw(0,0,FStorage);
end;
procedure TPlayGroundForm_Timer1Timer(Sender: TObject);
begin
//if csDestroying in ComponentState then exit;
TPlayGroundForm_UpdateImage;
end;
//********************************Event Handler*****************************//
procedure BtnClearClick(Sender: TObject);
begin
bfrm.refresh;
FormDrawBitmap(BITMAP1,540,10, bfrm.canvas);
FormDrawBitmap(BITMAP2,430,10, bfrm.canvas);
end;
procedure CloseClick(Sender: TObject; var action: TCloseAction);
begin
if mt <> NIL then begin
mT.enabled:= false;
mT.Free;
mT:= NIL;
end;
FMask.Free;
FPic.Free;
FStorage.Free;
action:= caFree;
Screen.Cursor:= crDefault;
writeln('Animation Form being closed');
end;
procedure CloseButtonClick(Sender: TObject);
begin
bfrm.Close; //calls close click
end;
procedure DblClickButton(Sender: TObject);
begin
SaveCanvas2(bfrm.Canvas, Exepath+SAVEPATH);
writeln('Animation Form being stored at: '+Exepath+SAVEPATH);
end;
procedure FormMouseDown(sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
BitBlt(FStorage.Canvas.Handle,0,0, FPic.Width, FPic.Height,
bfrm.Canvas.Handle, FNewRect.Left, FNewRect.Top, SRCCOPY);
end;
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);
//const FirstTime: boolean = True;
//var FOldRect: TRect; //makes a blur and zoom effect
begin
//firsttime:= true; //move tester
{ 1) Restore Form1: copy storage onto Form1 at its old location }
FOldRect:= Rect(280, 200, X , Y);
if FirstTime then FirstTime:= False
else BitBlt(bfrm.Canvas.Handle, FOldRect.Left, FOldRect.Top, FPic.Width,FPic.Height,
FStorage.Canvas.Handle,0,0,SRCCOPY);
{ save old location }
FNewRect:= Rect(X, Y, X + FPic.Width, Y + FPic.Height);
FOldRect:= FNewRect;
{ 2) Save copy of Form1: copy a rectangle from Form1 to storage at new location. }
BitBlt(FStorage.Canvas.Handle,0,0, FPic.Width, FPic.Height,
bfrm.Canvas.Handle, FNewRect.Left, FNewRect.Top, SRCCOPY);
{ 3) copy the image to Form1 using SRCINVERT }
BitBlt(bfrm.Canvas.Handle, FNewRect.Left, FNewRect.Top, FPic.Width, FPic.Height,
FPic.Canvas.Handle,0,0, SRCINVERT);
{ 4) copy the mask to Form1 using SRCAND }
BitBlt(bfrm.Canvas.Handle, FNewRect.Left, FNewRect.Top, FPic.Width, FPic.Height,
FMask.Canvas.Handle,0,0, SRCAND);
{ 5) copy the image to Form1 again using SRCINVERT }
BitBlt(bfrm.Canvas.Handle, FNewRect.Left, FNewRect.Top, FPic.Width, FPic.Height,
FPic.Canvas.Handle,0,0, SRCINVERT);
end;
//********************************Form Builder*****************************//
procedure InitBitmapForm;
begin
bfrm:= TForm.create(self);
mT:= TTimer.Create(self);
mt.onTimer:= @TPlayGroundForm_Timer1Timer;
mt.interval:= MILLISECONDS;
//mt.free; in on close
with bfrm do begin
//FormStyle := fsStayOnTop;
Position:= poScreenCenter;
caption:='Pulsar Bitmapulation BitmaX - DblClick to Save the PIC as PNG';
//color:= clsilver;
width:= 700;
height:= 550;
//canvas.Pen.mode:= pmNotXor;
onMouseMove:= @FormMouseMove;
onMouseDown:= @FormMouseDown;
onDblClick:= @DblClickButton;
onClose:= @CloseClick;
Show;
end;
with TBitBtn.create(self) do begin
parent:= bfrm;
setbounds(340,400,150,55)
font.size:= 12;
glyph.LoadFromResourceName(HINSTANCE,'CL_MPSTOP');
mXButton(05,05,width, height,12,12,handle);
caption:= '&Close App';
onClick:= @closeButtonClick;
end;
with TBitBtn.Create(bfrm) do begin
Parent:= bfrm;
setbounds(170,400,150, 55);
caption:= 'C&lear Form';
font.size:= 12;
glyph.LoadFromResourceName(getHINSTANCE,'CL_MPEJECT');
mXButton(05,05,width, height,12,12,handle);
onClick:= @BtnClearClick;
end;
FirstTime:= true;
end;
//*****************************Tester************************************
procedure Delay2StopWatch(msecs: integer);
var FirstTickCount: longint;
begin
FirstTickCount:= GetTickCount;
repeat
Application.ProcessMessages; {allowing access to other controls, widgets, etc.}
until ((GetTickCount-FirstTickCount) >= Longint(msecs));
end;
//Test it with:
procedure CallTicker(msecs: integer);
begin
with TStopWatch.create do begin
start
Delay2StopWatch(msecs)
stop
writeln('Stop Watch CPU Tester: '+getValueStr)
end;
end;
//********************************Tester End******************************//
begin //main of animationbox
//InifileRead;
getMaxBoxIni;
writeln('Thread ID :'+intToStr(CurrentThreadID))
writeln('Process ID :'+intToStr(CurrentProcessID))
writeln('machine name is: '+getHostName)
writeln('user name is: '+getUserName)
osType:= Win32Type;
writeln('OS Type is: '+intToStr(ord(osType)));
mytimestamp:= GetFileCreationTime(exepath+'maxbox4.exe')
writeln(DateTimeToStr(mytimestamp)+' for maXbox4 file')
//SearchAndOpenDoc(ExtractFilePath(ParamStr(0))+'docs\maxbox_starter16.pdf')
//ExecuteCommand('cmd','/k dir *.*')
BitmapFormCreate(self);
InitBitmapForm;
//FormDrawBitmap(BACKMAP,10,10, bfrm.canvas);
//FormDrawBitmap(BITMAP2,540,10, bfrm.canvas);
FormDrawBitmap(BITMAP2,430,10, bfrm.canvas);
CallTicker(500);
CurrencyFormat;
//TimeOutBox_API;
//[regex]//maXbox
End.
------------------------------------------------
Windows crashed again. I am the Blue Screen of Death. No one hears your screams.
Three things are certain: Death, taxes, and lost data. Guess which has occurred.
There is no place like 127.0.0.1
procedure RotateBitmap(var htmpBitmapDC: TBitmap; var lWidth : Longint;
var lHeight : Longint; lRadians : real; origmap: TBitmap);
var
I,J : Longint; // loop counter
//htmpBitmapDC : Longint; // DC of the new bitmap
lSine,lCosine : extended; // sine,cosine used in rotation
X1,X2,X3,Y1,Y2,Y3 : Longint; // used in calculating new bitmap dimensions
lMinX,lMaxX,lMinY,lMaxY: Longint;
lNewWidth,lNewHeight : Longint; // width of new bitmap
lSrcX,lSrcY : Longint; // x,y pixel coord we are blitting from the source image
myrect: TRect;
begin
// create a compatible DC from the one just brought
// compute the sine/cosinse of the radians used to // rotate this image
//tbmpDC:= tbmp.handle;
lSine := Sin(lRadians);
lCosine := Cos(lRadians);
// compute the size of the new bitmap being created
X1 := Round(-lHeight * lSine);
Y1 := Round(lHeight * lCosine);
X2 := Round(lWidth * lCosine - lHeight * lSine);
Y2 := Round(lHeight * lCosine + lWidth * lSine);
X3 := Round(lWidth * lCosine);
Y3 := Round(lWidth * lSine);
// figure out the max/min size of the new bitmap
lMinX := Min(0, Min(X1, Min(X2, X3)));
lMinY := Min(0, Min(Y1, Min(Y2, Y3)));
lMaxX := Max(X1, Max(X2, X3));
lMaxY := Max(Y1, Max(Y2, Y3));
// set the new bitmap width/height
lNewWidth:= lMaxX - lMinX;
lNewHeight:= lMaxY - lMinY;
// create a new bitmap based upon the new width/height of the // rotated bitmap
//hNewBitmap := CreateCompatibleBitmap(hBitmapDC, lNewWidth, lNewHeight);
htmpBitmapDC.height:= lNewHeight;
htmpBitmapDC.width:= lNewWidth;
//myRect:= Rect(0,0,lwidth,lheight);
//bfrm.Canvas.BrushCopy(MyRect, Image1.Picture.Bitmap, MyRect, clred);
For I:= 0 To lNewWidth do begin
For J:= 0 To lNewHeight do begin
lSrcX:= Round((J + lMinX) * lCosine + (I + lMinY) * lSine);
lSrcY:= Round((I + lMinY) * lCosine - (J + lMinX) * lSine);
If (lSrcX >= 0) And (lSrcX <= lWidth) And
(lSrcY >= 0) And (lSrcY <= lHeight) Then begin
BitBlt(htmpBitmapDC.canvas.handle,J,I,lnewheight,lnewwidth,origmap.canvas.handle,
lSrcX,lSrcY, SRCCOPY);
end;
end;
end;
//Image1.Refresh;
lWidth:= htmpBitmapDC.width;
lHeight:= htmpBitmapDC.height;
End;
procedure TForm1_RotateTest2(Sender: TObject);
var
lRadians: real;
tbmpDC, H,W, Degrees: longint;
mybitmap: TBitmap;
MyRect: TRect;
begin
mybitmap:= TBitmap.create;
mybitmap.loadfromfile(exepath+'examples\citymax.bmp')
image1.width:= mybitmap.width;
image1.height:= mybitmap.height;
//Image1.Picture.BitMap.PixelFormat:= pf24bit;
Image1.Picture.BitMap:= mybitmap;
//mybitmap.Free;
Degrees:= 45;
lRadians:= PI * Degrees / 180;
W:= Image1.Picture.Width;
H:= Image1.Picture.Height;
//W:= Image1.Width;
//H:= Image1.Height;
mybitmap:= TBitmap.create;
RotateBitmap(mybitmap, W, H, lRadians, Image1.Picture.Bitmap);
myRect:= Rect(0,0,W,H);
//bfrm.Canvas.CopyRect(MyOther,mybitmap.Canvas,MyRect);
Image1.Width:= W;
Image1.Height:= H;
Image1.Picture.Bitmap.Width:= W;
Image1.Picture.Bitmap.Height:= H;
//Image1.Picture.bitmap:= mybitmap;
BitBlt(Image1.Picture.Bitmap.Canvas.Handle,0,0,W,H,mybitmap.canvas.handle,0,0,SRCCopy);
//bfrm.Canvas.BrushCopy(MyRect, Image1.Picture.Bitmap, MyRect, clRed);
//for j:= 1 to image1.height do
//image1.Picture.Bitmap.Canvas.pixels[j,j]:= clred; //test line
mybitmap.Free;
Image1.Refresh;
end;
procedure CurrencyFormat;
var fSettings: TFormatSettings;
begin
GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, fSettings);
writeln(fsettings.timeAMString);
writeln(fsettings.longDateFormat);
writeln(fsettings.shortDateFormat);
//writeln(currtostrF
writeln('currtostrFS 1234.56 formats with setting as = '+
CurrToStrFS(1234.5678989, ffCurrency, 4, fSettings));
writeln(FloatToStrF(1234.5678989, ffCurrency, 6, 6));
writeln('currtostrFS and back as = '+
CurrToStrFS(strToCurr('1234.5678989'), ffCurrency, 4, fSettings));
end;
procedure maxcalc_demo;
begin
printF('this is %.6f',[maXcalc('ln(2)+fact(388)+2!')]);
printF('this is %.6f',[maXcalc('(4!)^(3!)')]);
printF('this is %.6f',[maXcalc('4!+4!')]);
printF('this is %.6f',[maXcalc('log(22)')]);
printF('this is logN %.6f',[maXcalc('2%256')]);
writeln('ln(e): '+floattostr(maXcalc('ln(e)')))
writeln(floattostr(maXcalc('e+10^6')))
printF('addition theorem %.18f ',[maXcalc('sin(2.5/2)')])
printF('addition theorem %.18f ',[maXcalc('sqrt(1/2*(1-cos(2.5)))')])
printF('addition theorem2 %22.18f ',[maXcalc('cos(2.5/2)')])
printF('addition theorem2 %22.18f ',[maXcalc('sqrt(1/2*(1+cos(2.5)))')])
maXcalcF('2%256+2^10');
end;
50000 = 0.693137180659968
100000 = 0.693142180584982
500000 = 0.693146180561005
10^6 = 0.693146680560255
5*10^6 = 0.693147080560068
50*10^6= 0.693147170560399 //Runtime: 0:28:22.422
ln(2) = 0.693147180559945
(* zeta:= 0;
for i:= 1 to 50000 do
if i mod 2 = 0 then
zeta:= zeta - 1/i else
zeta:= zeta + 1/i;
writeln('harmonic alternate to ln(2): '+floattostr(zeta))
writeln(floattostr(maxcalc('ln(2)')))
writeln(floattostr(ln2)) *)
type
//PThreadSortArray = ^TThreadSortArray;
//TThreadSortArray = array[0..MaxInt div SizeOf(Integer) - 1] of Integer;
TSortArray = array[1..ARRSIZE] of Integer;
TSortThread = class(TThread)
strict private
FBox: TPaintBox;
//FSortArray: PThreadSortArray;
FSortArray: TSortArray;
FSize: Integer;
FA, FB, FI, FJ: Integer;
Fbolthslowmotion: boolean;
procedure DoVisualSwap;
procedure Setbolthslowmotion(const Value: boolean);
protected
procedure Execute; override;
procedure VisualSwap(A, B, I, J: Integer);
procedure Sort(var A: array of Integer); virtual; abstract;
public
constructor Create(Box: TPaintBox; var SortArray: TSortArray);
property bolTHslowmotion: boolean read Fbolthslowmotion write Setbolthslowmotion;
end;
procedure SIRegister_TThreadSortForm(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TForm', 'TThreadSortForm') do
with CL.AddClassN(CL.FindClass('TForm'),'TThreadSortForm') do
begin
RegisterProperty('BubbleSortBox', 'TPaintBox', iptrw);
RegisterProperty('SelectionSortBox', 'TPaintBox', iptrw);
RegisterProperty('QuickSortBox', 'TPaintBox', iptrw);
RegisterProperty('Bevel1', 'TBevel', iptrw);
RegisterProperty('Bevel2', 'TBevel', iptrw);
RegisterProperty('Bevel3', 'TBevel', iptrw);
RegisterProperty('StartBtn', 'TButton', iptrw);
RegisterProperty('Label1', 'TLabel', iptrw);
RegisterProperty('Label2', 'TLabel', iptrw);
RegisterProperty('Label3', 'TLabel', iptrw);
RegisterProperty('BitBtn1slowmotion', 'TBitBtn', iptrw);
RegisterMethod('Procedure StartBtnClick( Sender : TObject)');
RegisterMethod('Procedure BubbleSortBoxPaint( Sender : TObject)');
RegisterMethod('Procedure SelectionSortBoxPaint( Sender : TObject)');
RegisterMethod('Procedure QuickSortBoxPaint( Sender : TObject)');
RegisterMethod('Procedure FormCreate( Sender : TObject)');
RegisterMethod('Procedure FormDestroy( Sender : TObject)');
RegisterMethod('Procedure FormKeyPress( Sender : TObject; var Key : Char)');
RegisterMethod('Procedure BitBtn1slowmotionClick( Sender : TObject)');
RegisterMethod('Procedure ThreadDone( Sender : TObject)');
RegisterProperty('mouse', 'boolean', iptrw);
end;
end;
***********************************Thread Class *****************************
TThread = class
private
{$IFDEF MSWINDOWS}
FHandle: THandle;
FThreadID: THandle;
{$ENDIF}
{$IFDEF LINUX}
// ** FThreadID is not THandle in Linux **
FThreadID: Cardinal;
FCreateSuspendedSem: TSemaphore;
FInitialSuspendDone: Boolean;
{$ENDIF}
FCreateSuspended: Boolean;
FTerminated: Boolean;
FSuspended: Boolean;
FFreeOnTerminate: Boolean;
FFinished: Boolean;
FReturnValue: Integer;
FOnTerminate: TNotifyEvent;
FSynchronize: TSynchronizeRecord;
FFatalException: TObject;
procedure CallOnTerminate;
class procedure Synchronize(ASyncRec: PSynchronizeRecord; QueueEvent: Boolean = False); overload;
{$IFDEF MSWINDOWS}
function GetPriority: TThreadPriority;
procedure SetPriority(Value: TThreadPriority);
{$ENDIF}
{$IFDEF LINUX}
// ** Priority is an Integer value in Linux
function GetPriority: Integer;
procedure SetPriority(Value: Integer);
function GetPolicy: Integer;
procedure SetPolicy(Value: Integer);
{$ENDIF}
procedure SetSuspended(Value: Boolean);
protected
procedure CheckThreadError(ErrCode: Integer); overload;
procedure CheckThreadError(Success: Boolean); overload;
procedure DoTerminate; virtual;
procedure Execute; virtual; abstract;
procedure Queue(AMethod: TThreadMethod); overload;
procedure Synchronize(AMethod: TThreadMethod); overload;
property ReturnValue: Integer read FReturnValue write FReturnValue;
property Terminated: Boolean read FTerminated;
public
constructor Create(CreateSuspended: Boolean);
destructor Destroy; override;
procedure AfterConstruction; override;
procedure Resume;
procedure Suspend;
procedure Terminate;
function WaitFor: LongWord;
class procedure Queue(AThread: TThread; AMethod: TThreadMethod); overload;
class procedure RemoveQueuedEvents(AThread: TThread; AMethod: TThreadMethod);
class procedure StaticQueue(AThread: TThread; AMethod: TThreadMethod);
class procedure Synchronize(AThread: TThread; AMethod: TThreadMethod); overload;
class procedure StaticSynchronize(AThread: TThread; AMethod: TThreadMethod);
property FatalException: TObject read FFatalException;
property FreeOnTerminate: Boolean read FFreeOnTerminate write FFreeOnTerminate;
{$IFDEF MSWINDOWS}
property Handle: THandle read FHandle;
property Priority: TThreadPriority read GetPriority write SetPriority;
{$ENDIF}
{$IFDEF LINUX}
// ** Priority is an Integer **
property Priority: Integer read GetPriority write SetPriority;
property Policy: Integer read GetPolicy write SetPolicy;
{$ENDIF}
property Suspended: Boolean read FSuspended write SetSuspended;
{$IFDEF MSWINDOWS}
property ThreadID: THandle read FThreadID;
{$ENDIF}
{$IFDEF LINUX}
// ** ThreadId is Cardinal **
property ThreadID: Cardinal read FThreadID;
{$ENDIF}
property OnTerminate: TNotifyEvent read FOnTerminate write FOnTerminate;
end;
8 Tipps für die richtige Business-Software-Auswahl!
Die Auswahl einer Business Software lässt verschiedene Lösungswege zu, selten gibt es ein klares Falsch. Einige abenteuerliche Ansätze die geradewegs und unbeirrbar zu den bekannten Projektschwierigkeiten führen, sollte man aber vermeiden. Unsere 8 Tipps für die Auswahl der Business-Software-Lösung helfen Ihnen, die richtige Lösung sowie den passenden Software-Partner zu finden:
Ganzes Angebot!
Gehen Sie von der ganzen Angebotspalette aus und entscheiden Sie sich nicht zu schnell für einen Anbieter.
Prozesse!
Analysieren Sie zuerst die Prozesse und definieren Sie dann die funktionale Abdeckung der Anforderungen.
Zukunft!
Versuchen Sie auch die Anpassungen des Systems an zukünftige Bedürfnisse abzuschätzen.
Potenzial des Partners!
Beurteilen Sie das Potenzial des Systemlieferanten.
Referenzen!
Besuchen Sie Referenzkunden mit ähnlichen Anforderungen. Verlassen Sie sich nicht einfach auf Aussagen von Kollegen und Partnern.
Drum prüfe wer sich bindet?
Hinter der evaluierten Lösung stehen immer auch Menschen mit denen Sie in den nächsten zehn Jahren zu tun haben. Beziehen Sie daher Aspekte wie «Sympathie und Chemie» in die Überlegungen ein.
Ressourcen!
Nehmen Sie sich Zeit! Die Einführung eines ERP-Systems braucht Zeit und das Management muss voll und ganz hinter dem Projekt stehen und die nötigen Ressourcen dazu freigeben.
Schulung, Schulung, Schulung!
Und ganz wichtig: Unterschätzen Sie nicht die Anwender-Schulung. Sie ist wichtig und braucht Zeit!
http://www.hitekdev.com/delphi/BITMAPANIMATION.html