Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   ¿Como poner un Gif animado en Rad Studio XE? (https://www.clubdelphi.com/foros/showthread.php?t=85048)

pokexperto1 18-01-2014 21:32:43

¿Como poner un Gif animado en Rad Studio XE?
 
Hola a todos, tengo una duda y es si puedo poner de algún modo un Gif animado en un programa por que he estado buscando y no hay manera. Aún así seguiré buscando por que he visto que hay un componente JEDI que si te deja poner. Gracias de antemano.

Mav 19-01-2014 02:29:27

gif animado
 
Yo lo hago así:
Desde Delphi 2007 en adelante, coloco un Timage con el gif y luego el code:
Código Delphi [-]
            ..............
          implementation
                     .................
          procedure TForm1.FormCreate(Sender:Tobject);
           begin
               (Image1.Picture.Graphic as TgifImage).Animate:=true;
           end;
...tambien podrias de esta manera controlar la animacion "AnimateLoop, AnimateSpeed...",transparencias del gif ...etc,etc.
Saludos!
:)

radenf 19-01-2014 11:54:18

Estimado pokexperto1:

Con este simple código a mi me funciona sin problemas. Lo colocas donde quieras que se inicie la animación.

Código Delphi [-]
Image1.Picture.LoadFromFile(ExtractFilePath(Application.Exename)+'\loader.gif');

Donde Image1 es un TImage y loader.gif es el gif animado que debes colocar en la carpeta del ejecutable.
No tengo DelphiXE, pero en D2007 y XE3 anda de maravillas.
Ojalá te sirva
Saludos

Mav 19-01-2014 21:47:40

Radenf, así cargas la imagen gif en el Tpicture, pero sin animacion,
por defecto la propiedad animation está asignada como false.....
:)

radenf 20-01-2014 11:10:25

Estimado Mav:

Delphi 2007 y XE3, que son los que yo uso, incluyen GifImage que permite la animación. Imagino que DelphiXE también la incluye.
Puedes revisar estos links, donde se utiliza el método que he indicado:

http://www.clubdelphi.com/foros/showthread.php?t=75261

http://www.clubdelphi.com/foros/show...ht=gif+animado

PD: No encuentro la propiedad Animate en los TImage.

Saludos

Mav 20-01-2014 23:13:42

GIFImg
 
....Delphi2007...en\\source\ GIFImg.pas y por lo tanto tambien en \\lib\GIFImg.dcu....
lo que se "une" a tu ejecutable: No hay animación.:
Código Delphi [-]
........................
//                      Global variables
//
////////////////////////////////////////////////////////////////////////////////
// GIF Clipboard format identifier for use by LoadFromClipboardFormat and
// SaveToClipboardFormat.
// Set in Initialization section.
var
  CF_GIF: WORD = 0;


////////////////////////////////////////////////////////////////////////////////
//
//                      Library defaults
//
////////////////////////////////////////////////////////////////////////////////
var
  //: Default options for TGIFImage.Draw
  GIFImageDefaultTransparent: boolean = True;
  GIFImageDefaultAnimate: boolean = False;//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< True =animado, False = no animado
  GIFImageDefaultAnimationLoop: TGIFAnimationLoop = glEnabled;
  GIFImageDefaultDithering: TGIFDithering = gdDisabled;
.......................
...en DelphiXE5:
...\\source\VCL\Vcl.Imaging.GIFImg.pas
Código Delphi [-]
     ...........
     .........
     /                      Global variables
//
////////////////////////////////////////////////////////////////////////////////
// GIF Clipboard format identifier for use by LoadFromClipboardFormat and
// SaveToClipboardFormat.
// Set in Initialization section.
var
  CF_GIF: WORD = 0;


////////////////////////////////////////////////////////////////////////////////
//
//                      Library defaults
//
////////////////////////////////////////////////////////////////////////////////
var
  //: Default options for TGIFImage.Draw
  GIFImageDefaultTransparent: boolean = True;
  GIFImageDefaultAnimate: boolean = False;//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  GIFImageDefaultAnimationLoop: TGIFAnimationLoop = glEnabled;
  GIFImageDefaultDithering: TGIFDithering = gdDisabled;

  //: Default color reduction methods for bitmap import.
  // These are the slowest settings, but also the ones that gives the
  // best result (in most cases).
  GIFImageDefaultColorReduction: TColorReduction = rmQuantize;
  GIFImageDefaultColorReductionBits: integer = 8; // Range 3 - 8
  GIFImageDefaultDitherMode: TDitherMode = dmFloydSteinberg;
Saludos:):)

Mav 21-01-2014 00:09:01

.....
Código Delphi [-]
 // Transparent property is declared in TGraphic.
    // property Transparent: boolean read GetTransparent write SetTransparent;
    property Animate: boolean read FAnimate write SetAnimate;
    property AnimateLoop: TGIFAnimationLoop read FAnimateLoop write SetAnimateLoop;
...otro fragmento de GIFIMg.pas, cambio la property Animate a true, para que se reproduzca la animacion, es lo que hago
en la primera respuesta a este tema.
Saludos:)


La franja horaria es GMT +2. Ahora son las 04:03:01.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi