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: 540
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 9 times
Been thanked: 110 times
Contact:

GIF animation demo

Post by gfilatov » Wed Dec 16, 2009 5:58 pm

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.JPG
Tgif image
tgif.JPG (22.33 KiB) Viewed 2514 times
tgif.zip
Demo application
(439.31 KiB) Downloaded 262 times
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
luisvasquezcl
Posts: 1074
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 12 times
Been thanked: 14 times
Contact:

Post by luisvasquezcl » Wed Dec 16, 2009 6:26 pm

Hi Grigory,
excelent demo ...
best regards,
luis vasquez

User avatar
Vanguarda
Posts: 543
Joined: Wed Feb 11, 2009 10:56 am
Location: Americana - SP
Been thanked: 1 time
Contact:

Post by Vanguarda » Wed Dec 16, 2009 6:39 pm

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: 5210
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 155 times
Been thanked: 144 times
Contact:

Post by Rathinagiri » Wed Dec 16, 2009 7:36 pm

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

Post by Ricci » Sat Dec 19, 2009 9:12 pm

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: 3905
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Sat Dec 19, 2009 9:27 pm

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: 540
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 9 times
Been thanked: 110 times
Contact:

Post by gfilatov » Sun Dec 20, 2009 10:57 am

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

Post by Ricci » Sun Dec 20, 2009 4:27 pm

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: 540
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 9 times
Been thanked: 110 times
Contact:

Post by gfilatov » Sun Dec 20, 2009 6:17 pm

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: 3905
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 15 times
Been thanked: 140 times

Post by Roberto Lopez » Sun Dec 20, 2009 7:23 pm

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