首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

用GifImage控件在Image1中放gif图片的有关问题

2012-04-27 
用GifImage控件在Image1中放gif图片的问题[del][/del]用GifImage控件在Image1中放gif图片,运行后图片总是

用GifImage控件在Image1中放gif图片的问题
[del][/del]用GifImage控件在Image1中放gif图片,运行后图片总是一闪一闪的.直接运行gif却是正常的.请教下为什么会这样,怎么解决这个问题?

[解决办法]

Delphi(Pascal) code
  Self.DoubleBuffered := True;
[解决办法]
有些手机屏幕小,但是依旧能够查看分辨率高的图片哦。
[解决办法]
procedure TImage.PictureChanged(Sender: TObject); 
var 
G: TGraphic; 
begin 
if AutoSize and (Picture.Width > 0) and (Picture.Height > 0) then 
SetBounds(Left, Top, Picture.Width, Picture.Height); 
G := Picture.Graphic; 
if G <> nil then 
begin 
if not ((G is TMetaFile) or (G is TIcon)) then 
G.Transparent := FTransparent; 
if (not G.Transparent) and Stretch and not Proportional then 
ControlStyle := ControlStyle + [csOpaque] 
else // picture might not cover entire clientrect 
ControlStyle := ControlStyle - [csOpaque]; 
if DoPaletteChange and FDrawing then Update; 
end 
else ControlStyle := ControlStyle - [csOpaque]; 
if not FDrawing then Invalidate; 
end; 

//从上面的VCL代码中可分析出哪些属性影响了透明效果,也就是Transparent:=False,Proportional=False时,不透明,也就不闪 


[解决办法]
与GIF的透明有关?

热点排行