H
hying95
Unregistered / Unconfirmed
GUEST, unregistred user!
动态创建TIMAGE,测试动画要动,但是我把它放到闪现窗口中,没反应,不知为什么?procedure TForm1.btn3Click(Sender: TObject);var Img: TImage; TmpGif :TGIFImage;begin TmpGif := TGIFImage.Create; TmpGif.LoadFromFile('./13.gif'); Img:=TImage.Create(Form1); Img.Parent:=Form1; Img.Top:=20; Img.Left:=20; Img.Width:=TmpGif.Width; Img.Height:=TmpGif.Height; Img.Picture.Assign(TmpGif);end;var FrmMove: TForm; TmpGif: TGifImage; TmpJpg: TJPEGImage; img: TImage; i: integer; Lis: TStrings;begin Application.Initialize; //************************************************************* TmpGif := TGIFImage.Create; TmpJpg:=TJPEGImage.Create; TmpGif.LoadFromFile('./13.Gif'); TmpJpg.LoadFromFile('./12.JPG'); FrmMove:=TForm.Create(Application);//Create创建闪现窗口对象 FrmMove.BorderStyle:= bsNone; FrmMove.Height:=TmpJpg.Height; FrmMove.Width:=TmpJpg.Width; FrmMove.Position:=poDesktopCenter; FrmMove.Show; FrmMove.Update; Lis:=tstringlist.Create; Lis.Add('第一行字符串...'); Lis.Add('第二行字符串.....'); Lis.Add('第三行字符串.......'); Lis.Add('第四行字符串.........'); FrmMove.Font.Charset:=GB2312_CHARSET; FrmMove.Font.Name:='宋体'; FrmMove.Font.Size:=14; FrmMove.Font.Style:=[fsBold]; Img:=TImage.Create(FrmMove); Img.Parent:=FrmMove; Img.Top:=212; Img.Left:=112; Img.Width:=TmpGif.Width; Img.Height:=TmpGif.Height; Img.Picture.Assign(TmpGif);//连图片都没有 for i := 0 to lis.Count-1 do begin FrmMove.Canvas.Draw(0,0,TmpJpg); //FrmMove.Canvas.Draw(212,112,img.Picture.Graphic);不注销这段,有图但是不动 frmmove.Canvas.Brush.Style := bsClear;//透明 frmmove.Canvas.Font.Color:=clBlue; frmmove.Canvas.TextOut(36,20,'正在初始化系统,请稍候......'); frmmove.Canvas.TextOut(36,50,lis.Strings); frmmove.Canvas.Refresh; sleep(600); end; img.Free; TmpGif.Free; lis.Free; FrmMove.Close; TmpJpg.Free; FrmMove.Free; //************************************************************* Application.CreateForm(TForm1, Form1); Application.Run;end.end.