添加一个TImageTTrackBar组件,设置Form的AlphaBlend属性为True
type加一句procedure FormCreate(Sender: TObject);
//写FormCreate(初始值)
procedure TForm1.FormCreate(Sender: TObject);
begin
self.AlphaBlend:=true;
self.TrackBar1.Min:=0;
self.TrackBar1.Max:=250;
self.TrackBar1.Frequency:=1;
end;
-----------------------源码-----------------------------

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, jpeg, ExtCtrls;

type
  TForm1 = class(TForm)
    Image1: TImage;
    TrackBar1: TTrackBar;
    procedure FormCreate(Sender: TObject);
    procedure TrackBar1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
self.AlphaBlend:=true;
self.TrackBar1.Min:=0;
self.TrackBar1.Max:=250;
self.TrackBar1.Frequency:=1;
end;

procedure TForm1.TrackBar1Change(Sender: TObject);
begin
self.AlphaBlendValue:=self.TrackBar1.Max-self.TrackBar1.Position;
end;

end.


Posted on 2011-03-23 22:27  dekill  阅读(145)  评论(0编辑  收藏  举报