用GifImage控件在Image1中放gif图片的有关问题
用GifImage控件在Image1中放gif图片的问题
[del][/del]用GifImage控件在Image1中放gif图片,运行后图片总是一闪一闪的.直接运行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的透明有关?