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;
Procedure Button1Click (Sender:tobject);
Procedure Button2click (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);
Var
W,h,i:integer;
Begin
W: = DXPaintBox1.DIB.Width;
H: = DXPaintBox1.DIB.Height;
For I: = 0 to 9999 do begin
DXPaintBox1.DIB.BlendPixel (Random (w), Random (H Div 2), clred, 255);
DXPaintBox1.DIB.BlendPixel (Random (w), Random (H Div 2) + (H Div 2), clred, 64);
End
Dxpaintbox1.repaint;
End
End.