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;
Button4:tbutton;
Button5:tbutton;
Button6:tbutton;
Button7:tbutton;
Button8:tbutton;
Button9:tbutton;
Procedure Formcreate (Sender:tobject);
Procedure Formdestroy (Sender:tobject);
Procedure Button1Click (Sender:tobject);
Procedure Button2click (Sender:tobject);
Procedure Button3click (Sender:tobject);
Procedure Button4click (Sender:tobject);
Procedure Button5click (Sender:tobject);
Procedure Button6click (Sender:tobject);
Procedure Button7click (Sender:tobject);
Procedure Button8click (Sender:tobject);
Procedure Button9click (Sender:tobject);
End
Var
Form1:tform1;
Implementation
{$R *.DFM}
Var
Dib:tdib;
Procedure Tform1.formcreate (Sender:tobject);
Begin
Dib: = Tdib. Create;
Dib. SetSize (Dxpaintbox1.width, Dxpaintbox1.height, 24);
Dib. Fill (0);
Dib. Canvas.Brush.Style: = Bsclear;
Dib. Canvas.Font.Color: = clred;
Dib. Canvas.Font.Name: = ' Tahoma ';
Dib. Canvas.Font.Size: = 32;
Dib. Canvas.Font.Style: = [Fsbold];
Dib. Canvas.textout (A, ' Delphix ');
Self.color: = Clwhite;
End
Procedure Tform1.formdestroy (Sender:tobject);
Begin
Dib. Free;
End
Procedure Tform1.button1click (Sender:tobject);
Begin
DXPaintBox1.DIB.Assign (DIB);
Dxpaintbox1.repaint;
End
Procedure Tform1.button2click (Sender:tobject);
Begin
DXPaintBox1.DIB.Fill (Self.color);
DXPaintBox1.DIB.DrawQuickAlpha (DIB, 0, 0, Dib.) Width, Dib. Height, 0, 0, Clblack, fmnormal);
Dxpaintbox1.repaint;
End
Procedure Tform1.button3click (Sender:tobject);
Begin
DXPaintBox1.DIB.Fill (Self.color);
DXPaintBox1.DIB.DrawQuickAlpha (DIB, 0, 0, Dib.) Width, Dib. Height, 0, 0, Clblack, fmMix75);
Dxpaintbox1.repaint;
End
Procedure Tform1.button4click (Sender:tobject);
Begin
DXPaintBox1.DIB.Fill (Self.color);
DXPaintBox1.DIB.DrawQuickAlpha (DIB, 0, 0, Dib.) Width, Dib. Height, 0, 0, Clblack, fmMix50);
Dxpaintbox1.repaint;
End
Procedure Tform1.button5click (Sender:tobject);
Begin
DXPaintBox1.DIB.Fill (Self.color);
DXPaintBox1.DIB.DrawQuickAlpha (DIB, 0, 0, Dib.) Width, Dib. Height, 0, 0, Clblack, fmMix25);
Dxpaintbox1.repaint;
End
Procedure Tform1.button6click (Sender:tobject);
Begin
DXPaintBox1.DIB.Fill (Self.color);
DXPaintBox1.DIB.DrawQuickAlpha (DIB, 0, 0, Dib.) Width, Dib. Height, 0, 0, clred, fmnormal);
Dxpaintbox1.repaint;
End
Procedure Tform1.button7click (Sender:tobject);
Begin
DXPaintBox1.DIB.Fill (Self.color);
DXPaintBox1.DIB.DrawQuickAlpha (DIB, 0, 0, Dib.) Width, Dib. Height, 0, 0, clred, fmMix75);
Dxpaintbox1.repaint;
End
Procedure Tform1.button8click (Sender:tobject);
Begin
DXPaintBox1.DIB.Fill (Self.color);
DXPaintBox1.DIB.DrawQuickAlpha (DIB, 0, 0, Dib.) Width, Dib. Height, 0, 0, clred, fmMix50);
Dxpaintbox1.repaint;
End
Procedure Tform1.button9click (Sender:tobject);
Begin
DXPaintBox1.DIB.Fill (Self.color);
DXPaintBox1.DIB.DrawQuickAlpha (DIB, 0, 0, Dib.) Width, Dib. Height, 0, 0, clred, fmMix25);
Dxpaintbox1.repaint;
End
End.