P
prosky
Unregistered / Unconfirmed
GUEST, unregistred user!
有一个gif透明图片,经过处理(添加文字)后,得到的图片不在透明了,原来透明的地方变成了白色,怎么解决这个问题?
高手帮我调试一下啊。感谢!感谢!
程序源代码如下:
//RxGIFAnimator1是事先载入的gif图片,RxGIFAnimator2是处理后生成的gif图片
//使用了RxGIFAnimator1.image.Transparent:=ture;bmp.Transparent:=true;RxGIFAnimator2.image.Transparent:=ture;都不管用。
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Animate, GIFCtrl;
type
TForm1 = class(TForm)
RxGIFAnimator1: TRxGIFAnimator;
Button1: TButton;
RxGIFAnimator2: TRxGIFAnimator;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
bmp :TBitMap;
begin
bmp := TBitMap.Create;
bmp.Assign(RxGIFAnimator1.Image);
//处理图片
bmp.Canvas.Brush.Style := bsClear;
bmp.Canvas.Font.Color := clRed;
bmp.Canvas.Font.Size := 12;
bmp.Canvas.TextOut(20,6,'添加文字');
RxGIFAnimator2.Image.Assign(bmp);
bmp.Free;
end;
end.
高手帮我调试一下啊。感谢!感谢!
程序源代码如下:
//RxGIFAnimator1是事先载入的gif图片,RxGIFAnimator2是处理后生成的gif图片
//使用了RxGIFAnimator1.image.Transparent:=ture;bmp.Transparent:=true;RxGIFAnimator2.image.Transparent:=ture;都不管用。
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Animate, GIFCtrl;
type
TForm1 = class(TForm)
RxGIFAnimator1: TRxGIFAnimator;
Button1: TButton;
RxGIFAnimator2: TRxGIFAnimator;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
bmp :TBitMap;
begin
bmp := TBitMap.Create;
bmp.Assign(RxGIFAnimator1.Image);
//处理图片
bmp.Canvas.Brush.Style := bsClear;
bmp.Canvas.Font.Color := clRed;
bmp.Canvas.Font.Size := 12;
bmp.Canvas.TextOut(20,6,'添加文字');
RxGIFAnimator2.Image.Assign(bmp);
bmp.Free;
end;
end.