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;
Button2:tbutton;
Button3:tbutton;
Procedure Button1Click (Sender:tobject);
Procedure Button2click (Sender:tobject);
Procedure Button3click (Sender:tobject);
End
Var
Form1:tform1;
Implementation
{$R *.DFM}
Procedure Tform1.button1click (Sender:tobject);
Const
ImgPath1 = ' C:\Temp\DX.jpg ';
Begin
DXPaintBox1.DIB.LoadFromFile (IMGPATH1);
Dxpaintbox1.width: = DXPaintBox1.DIB.Width;
Dxpaintbox1.height: = DXPaintBox1.DIB.Height;
Dxpaintbox1.repaint;
End
Procedure Tform1.button2click (Sender:tobject);
Begin
DXPaintBox1.DIB.Ink (Dxpaintbox1.dib, True, 64);
Dxpaintbox1.repaint;
End
Procedure Tform1.button3click (Sender:tobject);
Begin
DXPaintBox1.DIB.Ink (Dxpaintbox1.dib, False, 64);
Dxpaintbox1.repaint;
End
End.