This example effect chart:
Code files:
Unit Unit1;
Interface
Uses
Windows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms,
Dialogs, DIB, Stdctrls;
Type
TForm1 = Class (Tform)
Dxpaintbox1:tdxpaintbox;
Button1:tbutton;
Procedure Formcreate (Sender:tobject);
Procedure Formdestroy (Sender:tobject);
Procedure Button1Click (Sender:tobject);
End
Var
Form1:tform1;
Implementation
{$R *.DFM}
Uses typinfo;
Var
Dib:tdib;
F:integer;
Procedure Tform1.button1click (Sender:tobject);
Const
CLR = clred;
Var
W,h,a,b:integer;
Begin
DXPaintBox1.DIB.Assign (DIB);
W: = Dxpaintbox1.clientwidth;
H: = Dxpaintbox1.clientheight;
A: = w div 7;
B: = h div 7;
DXPaintBox1.DIB.FilterLine (0, B, W, B, CLR, Tfiltermode (f));
DXPaintBox1.DIB.FilterLine (0, H-b, W, H-b, CLR, Tfiltermode (f));
DXPaintBox1.DIB.FilterLine (A, 0, a, h, CLR, Tfiltermode (f));
DXPaintBox1.DIB.FilterLine (w-a, 0, W-a, H, CLR, Tfiltermode (f));
DXPaintBox1.DIB.FilterRect (w Div 5, H Div 5, W div 5*3, H div 5*3, CLR, Tfiltermode (f));
Dxpaintbox1.repaint;
Text: = Getenumname (TypeInfo (Tfiltermode), f);
Inc. (f); F: = f and 3;
End
Procedure Tform1.formcreate (Sender:tobject);
Const
ImgPath1 = ' C:\Temp\DX.jpg ';
Begin
Dib: = Tdib. Create;
Dib. LoadFromFile (IMGPATH1);
DXPaintBox1.DIB.Assign (DIB);
Dxpaintbox1.width: = Dib. Width;
Dxpaintbox1.height: = Dib. Height;
Dxpaintbox1.repaint;
End
Procedure Tform1.formdestroy (Sender:tobject);
Begin
Dib. Free;
End
End.