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;
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);
End
Var
Form1:tform1;
Implementation
{$R *.DFM}
Var
Dib:tdib;
Procedure Tform1.formcreate (Sender:tobject);
Const
ImgPath1 = ' C:\Temp\DX.jpg ';
Begin
Dib: = Tdib. Create;
Dib. LoadFromFile (IMGPATH1);
Dxpaintbox1.width: = Dib. Width;
Dxpaintbox1.height: = Dib. Height;
DXPaintBox1.DIB.Assign (DIB);
Dxpaintbox1.repaint;
End
Procedure Tform1.formdestroy (Sender:tobject);
Begin
Dib. Free;
End
Procedure Tform1.button1click (Sender:tobject);
Begin
DXPaintBox1.DIB.Draw3x3Matrix (DIB, Msemboss);
Dxpaintbox1.repaint;
End
Procedure Tform1.button2click (Sender:tobject);
Begin
DXPaintBox1.DIB.Draw3x3Matrix (DIB, Mshardemboss);
Dxpaintbox1.repaint;
End
Procedure Tform1.button3click (Sender:tobject);
Begin
DXPaintBox1.DIB.Draw3x3Matrix (DIB, Msblur);
Dxpaintbox1.repaint;
End
Procedure Tform1.button4click (Sender:tobject);
Begin
DXPaintBox1.DIB.Draw3x3Matrix (DIB, Mssharpen);
Dxpaintbox1.repaint;
End
Procedure Tform1.button5click (Sender:tobject);
Begin
DXPaintBox1.DIB.Draw3x3Matrix (DIB, msedgedetect);
Dxpaintbox1.repaint;
End
Procedure Tform1.button6click (Sender:tobject);
Const
ms:tmatrixsetting = ( -9,1,-2,-10,-7,4,-4,-3,1,-5);
Begin
DXPaintBox1.DIB.Draw3x3Matrix (DIB, MS);
Dxpaintbox1.repaint;
End
End.