
TDIB.Sharpen(Amount: Integer) 增強圖像邊緣銳度。參數 Amount 控制強度,範例使用 1 輕微銳化。
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
ImgPath = 'C:\Temp\DX.jpg';
begin
DXPaintBox1.DIB.LoadFromFile(ImgPath);
DXPaintBox1.Width := DXPaintBox1.DIB.Width;
DXPaintBox1.Height := DXPaintBox1.DIB.Height;
DXPaintBox1.Repaint;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
DXPaintBox1.DIB.Sharpen(1);
DXPaintBox1.Repaint;
end;
end.
object Form1: TForm1
ClientHeight = 142; ClientWidth = 226
object DXPaintBox1: TDXPaintBox
Left = 8; Top = 8; Width = 81; Height = 73
end
object Button1: TButton; Left = 143; Top = 78; Caption = 'Load'
object Button2: TButton; Left = 143; Top = 109; Caption = 'Sharpen'
end