GIF animation demo

You can share your experience with HMG. Share with some screenshots/project details so that others will also be benefited.

Moderator: Rathinagiri

User avatar
gfilatov
Posts: 1060
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

GIF animation demo

Post by gfilatov »

Hello Friends,

I want to present a small GIF animation demo based upon the Harbour TGif class.

Code: Select all

/*
 * MINIGUI - Harbour Win32 GUI library Demo
 *
 * Copyright 2002-09 Roberto Lopez <harbourminigui@gmail.com>
 *
 * Based upon sample Minigui\Samples\Advanced\AnimatedGif
 * Author: P.Chornyj <myorg63@mail.ru>
 *
 * Harbour TGif class
 * Copyright 2009 Grigory Filatov <gfilatov@freemail.ru>
*/

#include "minigui.ch"

Function Main()
Local oGif

	SET MULTIPLE OFF WARNING

	DEFINE WINDOW Form_Main ;
		AT 0,0 ;
		WIDTH 0 HEIGHT 0 ;
		TITLE 'Gif89 Demo' ;
		MAIN NOMAXIMIZE NOSIZE ;
		ON INTERACTIVECLOSE OnClose( oGif )

		DEFINE MAIN MENU

			DEFINE POPUP "&File" 

				MENUITEM '&Play' ACTION IIF( !oGif:IsRunning(), oGif:Play(), )
				MENUITEM '&Stop' ACTION IIF( oGif:IsRunning(), oGif:Stop(), )
				SEPARATOR
				MENUITEM "E&xit" ACTION OnClose( oGif )

			END POPUP

			DEFINE POPUP "&?" 

				MENUITEM "GIF &Info" ACTION IIF( oGif:nTotalFrames > 1, ;
					( oGif:Stop(), MsgInfo( ;
					"Picture name" + Chr(9) + ": " + cFileNoPath( oGif:cFileName ) + CRLF + ;
					"Image Width"  + Chr(9) + ": " + hb_ntos( oGif:nWidth ) + CRLF + ;
					"Image Height" + Chr(9) + ": " + hb_ntos( oGif:nHeight ) + CRLF + ;
					"Total Frames" + Chr(9) + ": " + hb_ntos( oGif:nTotalFrames ) + CRLF + ;
					"Current Frame" + Chr(9) + ": " + hb_ntos( oGif:nCurrentFrame ), ;
					"GIF Info" ), oGif:Play() ), )

			END POPUP

		END MENU

		oGif := TGif():New( 'santa.gif', 20, 20, 120, 350, 95 )

	END WINDOW

	Form_Main.Width := Max( 180, oGif:nWidth + 2 * GetBorderWidth() + 40 )
	Form_Main.Height := GetTitleHeight() + oGif:nHeight + 2 * GetBorderHeight() + 60
	oGif:nLeft := ( Form_Main.Width - oGif:nWidth - 2 * GetBorderWidth() ) / 2 + 1

	DRAW PANEL IN WINDOW Form_Main ;
		AT oGif:nTop - 2, oGif:nLeft - 2 ;
		TO oGif:nBottom, oGif:nRight

	CENTER WINDOW Form_Main

	ACTIVATE WINDOW Form_Main

Return Nil

/*
*/
Function OnClose( oGif )

	oGif:End()

	ThisWindow.Release()

Return Nil
Your comments are welcome :!:
Attachments
Tgif image
Tgif image
tgif.JPG (22.33 KiB) Viewed 6877 times
tgif.zip
Demo application
(439.31 KiB) Downloaded 502 times
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: GIF animation demo

Post by luisvasquezcl »

Hi Grigory,
excelent demo ...
best regards,
luis vasquez
User avatar
Vanguarda
Posts: 543
Joined: Wed Feb 11, 2009 10:56 am
Location: Americana - SP
Contact:

Re: GIF animation demo

Post by Vanguarda »

Hi friends,

Thanks Grigory for share this nice demo.

Best regards,
--
Paulo Sérgio Durço (Vanguarda)


http://hmglights.wordpress.com/
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: GIF animation demo

Post by Rathinagiri »

Thanks for sharing Grigory.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: GIF animation demo

Post by Ricci »

gfilatov wrote:Hello Friends,

I want to present a small GIF animation demo based upon the Harbour TGif class.
Your comments are welcome :!:
Where do i get this TGif class ? I can´t compile your source.

Solved :D
And learned: never use a directory name with a space for compiling ("Animated GIFs") !!

But i´m still not able to compile: "DRAW PANEL IN WINDOW ..."
Compiler didn´t know the word PANEL.
Last edited by Ricci on Sun Dec 20, 2009 10:29 am, edited 2 times in total.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: GIF animation demo

Post by Roberto Lopez »

gfilatov wrote:Hello Friends,

I want to present a small GIF animation demo based upon the Harbour TGif class.
<...>
Your comments are welcome :!:
Nice!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
gfilatov
Posts: 1060
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: GIF animation demo

Post by gfilatov »

Ricci wrote:
gfilatov wrote:Hello Friends,

I want to present a small GIF animation demo based upon the Harbour TGif class.
Your comments are welcome :!:
Where do i get this TGif class ? I can´t compile your source.

Solved :D
And learned: never use a directory name with a space for compiling ("Animated GIFs") !!

But i´m still not able to compile: "DRAW PANEL IN WINDOW ..."
Compiler didn´t know the word PANEL.
Hello,

The command DRAW PANEL exists in the HMG Extended Edition.
The new TGif class will be available at the next buid of HMG EE :arrow:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

Re: GIF animation demo

Post by Ricci »

gfilatov wrote:The command DRAW PANEL exists in the HMG Extended Edition.
What is the difference between the Standard and the Extended Edition?
Which one should i use?
At the moment i use HMG 3 Test XII.
User avatar
gfilatov
Posts: 1060
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: GIF animation demo

Post by gfilatov »

Ricci wrote:
gfilatov wrote:The command DRAW PANEL exists in the HMG Extended Edition.
What is the difference between the Standard and the Extended Edition?
Which one should i use?
At the moment i use HMG 3 Test XII.
Ricci,

Thanks for your interest :!:
It is an individual preference because the Extended Edition is a fork from the Official HMG and based upon Borland C++ (preferable), MinGW or Pelles C compilers. :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: GIF animation demo

Post by Roberto Lopez »

gfilatov wrote: The command DRAW PANEL exists in the HMG Extended Edition.
The new TGif class will be available at the next buid of HMG EE :arrow:
:mrgreen:

Could be you so kind to post the DRAW PANEL command source code adapted for HMG?

So, I could add in the 'PROPOSED.FEATURES' folder of the next HMG release... or better... you could add the code to HFCL.

TIA.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply