S
sxwy
Unregistered / Unconfirmed
GUEST, unregistred user!
想在一个图片的上面再放一个图片,但第二个图片要求透明的(第二个图片只有文字信息),以下代码不能实现,求助高手帮忙.
Var Tmp1,tmp2:Tbitmap;
begin
Tmp1:=Tbitmap.Create ;
Tmp1.Width :=128;
Tmp1.Height :=64;
Tmp1.Canvas.Brush.Color :=Clblack;
Tmp1.Canvas.Font.Name:='宋体';
Tmp1.Canvas.Brush.Style :=Bsclear;
Tmp1.Canvas.FillRect(Tmp1.Canvas.ClipRect);
Tmp1.Canvas.TextOut(0,0,'test12345678');
Image1.Picture.Bitmap.Assign(Tmp1);
Tmp2:=Tbitmap.Create ;
Tmp2.Width :=128;
Tmp2.Height :=64;
Tmp2.Canvas.Brush.Color :=Clblack;
Tmp2.Canvas.Font.Name :='宋体';
Tmp2.Transparent :=True;
Tmp2.Canvas.Brush.Style:=Bsclear;
Tmp2.Canvas.FillRect(Tmp2.Canvas.ClipRect);
Tmp2.Canvas.TextOut(5,0,'test12345678');
Image2.Picture.Bitmap.Assign(tmp2);
Tmp1.Free ;
Tmp2.Free;
Var Tmp1,tmp2:Tbitmap;
begin
Tmp1:=Tbitmap.Create ;
Tmp1.Width :=128;
Tmp1.Height :=64;
Tmp1.Canvas.Brush.Color :=Clblack;
Tmp1.Canvas.Font.Name:='宋体';
Tmp1.Canvas.Brush.Style :=Bsclear;
Tmp1.Canvas.FillRect(Tmp1.Canvas.ClipRect);
Tmp1.Canvas.TextOut(0,0,'test12345678');
Image1.Picture.Bitmap.Assign(Tmp1);
Tmp2:=Tbitmap.Create ;
Tmp2.Width :=128;
Tmp2.Height :=64;
Tmp2.Canvas.Brush.Color :=Clblack;
Tmp2.Canvas.Font.Name :='宋体';
Tmp2.Transparent :=True;
Tmp2.Canvas.Brush.Style:=Bsclear;
Tmp2.Canvas.FillRect(Tmp2.Canvas.ClipRect);
Tmp2.Canvas.TextOut(5,0,'test12345678');
Image2.Picture.Bitmap.Assign(tmp2);
Tmp1.Free ;
Tmp2.Free;