Classe TGif

Classe TGif

Postby oliveiros junior » Thu Dec 07, 2023 8:00 pm

Olá, boa tarde!

Existe alguma definição especifica do GIF para utilizar a classe TGif?

Att.,

Oliveiros Junior
oliveiros junior
 
Posts: 125
Joined: Tue Mar 20, 2007 3:13 pm

Re: Classe TGif

Postby Antonio Linares » Fri Dec 08, 2023 8:22 am

Dear Oliveiros,

The kind of GIF file that is needed is a standard GIF file that follows the GIF89a specification. This means that the GIF file should have the following characteristics:

It should have a header that identifies the file as a GIF file and specifies the version of the format. The header should be six bytes long and contain the ASCII characters “GIF89a”

It should have a logical screen descriptor that defines the dimensions and properties of the logical screen. The logical screen descriptor should be seven bytes long and contain the following fields: logical screen width, logical screen height, global color table flag, color resolution, sort flag, size of global color table, background color index, and pixel aspect ratio

It should have a global color table that contains the colors used in the image. The global color table should be present if the global color table flag is set to 1 in the logical screen descriptor. The size of the global color table should be 2^(size of global color table + 1) bytes, where each byte represents one color component (red, green, or blue) of a color.

It should have one or more image descriptors that define the dimensions and properties of each image in the file. The image descriptor should start with a byte containing the ASCII character “,”, followed by the following fields: image left position, image top position, image width, image height, local color table flag, interlace flag, sort flag, size of local color table, and local color table (optional).

It should have one or more image data blocks that contain the compressed pixel data of each image in the file. The image data blocks should start with a byte containing the LZW minimum code size, followed by one or more sub-blocks of data. Each sub-block should start with a byte containing the size of the sub-block, followed by the actual data bytes. The last sub-block should have a size of zero, indicating the end of the image data

It should have one or more graphic control extensions that specify the animation parameters of each image in the file. The graphic control extension should start with a byte containing the ASCII character “!”, followed by a byte containing the value 249, followed by a byte containing the block size (usually 4), followed by the following fields: reserved, disposal method, user input flag, transparent color flag, delay time, transparent color index, and block terminator (a byte containing the value 0

It should have an application extension that specifies the looping behavior of the animation. The application extension should start with a byte containing the ASCII character “!”, followed by a byte containing the value 255, followed by a byte containing the block size (usually 11), followed by the application identifier (“NETSCAPE”), followed by the application authentication code (“2.0”), followed by a sub-block containing the loop count, followed by a block terminator (a byte containing the value 0)

It should have a trailer that marks the end of the file. The trailer should be a single byte containing the ASCII character “;”
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Classe TGif

Postby karinha » Fri Dec 08, 2023 2:20 pm

oliveiros junior wrote:Olá, boa tarde!

Existe alguma definição especifica do GIF para utilizar a classe TGif?

Att.,

Oliveiros Junior


caro, explique: "definição especifica" ??

O que você quer saber realmente?

Obg. abs.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Classe TGif

Postby oliveiros junior » Fri Dec 08, 2023 3:57 pm

Thanks master Antonio.
Last edited by oliveiros junior on Fri Dec 08, 2023 4:00 pm, edited 1 time in total.
oliveiros junior
 
Posts: 125
Joined: Tue Mar 20, 2007 3:13 pm

Re: Classe TGif

Postby oliveiros junior » Fri Dec 08, 2023 4:00 pm

Olá Karinha,

Tenho um gif que não roda de jeito nenhum com a TGif. Ao executar, ele sai do sistema sem gerar nenhuma mensagem. Vou verificar com quem fez o gif se ele atende as especificações citadas pelo Antônio Linhares acima.

Obrigado pela atenção.

Oliveiros Junior
oliveiros junior
 
Posts: 125
Joined: Tue Mar 20, 2007 3:13 pm

Re: Classe TGif

Postby karinha » Fri Dec 08, 2023 4:23 pm

Oliveiros, como você está fazendo?

Code: Select all  Expand view

#include "FiveWin.ch"
#include "gif.ch"

function Main()

   local oDlg

   DEFINE DIALOG oDlg TITLE "Attention"

   @ 2, 11 SAY "Waiting to use the calculator"

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT PlaceGif( oDlg )

return nil

function PlaceGif( oDlg )

   local oGif

   @ 19, 10 GIF oGif FILENAME "..\gifs\loading.gif" OF oDlg

return nil

   //  LOCAL oGif

   // @ 61.50, 0  GIF oGif FILE ".\AMBIENTY.GIF" SIZE 230, 100 ADJUST

   /*
   IF FILE( "AMBIENTY.GIF" )

      @ 54.00, 01 GIF oGif FILE ".\AMBIENTY.GIF" SIZE 1019, 240 ADJUST

      // TELA CHEIA
      // @ 54.00, 01 GIF oGif FILE ".\AMBIENTY.GIF" SIZE 1019, 582 ADJUST

      oGif:lTransparent := .T.

   ENDIF
   */


   //   @ 050, 900 GIF oGif FILE ".\HALO.GIF" SIZE 090, 080 ADJUST OF oRebar

Abs.
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Classe TGif

Postby sysctrl2 » Fri Dec 08, 2023 9:28 pm

Antonio, Gracias por le explicación
pero solo queremos saber como
se programan en FWH :D :) :( :o :shock:
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 1020
Joined: Mon Feb 05, 2007 7:15 pm

Re: Classe TGif

Postby Antonio Linares » Sat Dec 09, 2023 8:23 am

FWH\samples\testgif.prg, testgif2.prg, testgifr.prg
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Classe TGif

Postby oliveiros junior » Sat Dec 09, 2023 12:46 pm

Olá Karinha,

Eu peguei os exemplos testgif.prg, testgif2.prg, testgifr.prg e apenas troquei o nome do meu gif e coloquei gif na pasta gifs. Ele compila mas não executa o programa.

Att.,

Oliveiros Junior
oliveiros junior
 
Posts: 125
Joined: Tue Mar 20, 2007 3:13 pm

Re: Classe TGif

Postby jll-fwh » Sun Dec 10, 2023 8:29 pm

Hola a todos.

Antonio, eso si es una magnifica explicación técnica de 10. :D

Yo, documentando y verificando que todo estaba correcto de este programa pReproducir ver 1.5 32bits que en breve subiré para que se pueda descargar, me paso lo mismo que a oliveiros junior. Una de las noches se me ocurrió cambiar el Gif de fondo blanco a otro de fondo negro, hice una copia de seguridad y sin probarlo lo deje. Al día siguiente ejecuto el programa y se cerraba automáticamente sin errores cuando el día anterior funciona perfectamente. No tenia ni idea que pasaba cuando el código estaba perfecto. Estuve probando de todo durante un par de horas y nada, hasta que decidí dejarlo todo exactamente igual a cuando funcionaba todo perfecto. Yo uso el Gif para emular un grafico de sonido y es la leche porque con los métodos puedes iniciarlo, pararlo, etc, cuando cambia de canción automáticamente, detenerlo, en espera o pararlo el programa lo detiene, lo para o deja que continúe. El truco es magnifico.

Cual era el problema, pues sencillamente el archivo GIF. no son todos validos para FWH y ahora entenderéis la extensa explicación de Antonio. La clase funciona perfecta, si tenéis este problema es el GIF.

oliveiros junior, tu problema es el GIF.

Imagen1:
Image

Yo estoy usando como reproductor de música mi programa usando ActiveX con el API de WMP ( windows media player ). Según microsoft se queda como reproductor para windows 11 y posteriores.

Espero que os sirva la explicación.
Un abrazo;
Javier Lloris
javierllorisprogramador@gmail.com

Blogs personales:
Programación: https://javierlloris.blogspot.com/
Japonés: https://bitacorajaponesa.blogspot.com/
Cubos de Rubik: https://www.instagram.com/jllorisperson ... 2ybz0gmvul
Tengo una colección de unos 100 cubos de todo tipo de formas geométricas, todos resueltos, en instagram solo hay unos cuentos cubos.
Libreria: FWH/FWH1109 + Harbour 5.8.2 + Borland C++ 5.8.2
Editor de Recursos: PellecC
ADA, OURXDBU
S.O: XP / Win 7 /Win10
Blog: http://javierlloris.blogspot.com.es/
e-mail: javierllorisprogramador@gmail.com
User avatar
jll-fwh
 
Posts: 408
Joined: Fri Jan 29, 2010 8:14 pm
Location: Meliana - Valencia


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 40 guests