Rechard_Long

Image animation element running continuously

28 posts in this topic

Currently they have 51 so- called same image is BF_001.PNG By BF_0051.PNG . Now when you want to create GUI opens its first load runs continuously ( think Sleep ( 80 ) is it rather a new image ) is dc but I did it twitched. I give up with this ,

Thanks for all :(

Share this post


Link to post
Share on other sites



Please try to make your description of your problem more readable.

1 person likes this

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites
15 hours ago, mLipok said:

Please try to make your description of your problem more readable.

Sorry . I am Vietnamese. I used Google Translate to describe , I do not know english

Share this post


Link to post
Share on other sites

Hum probably mLipok's comment meant also : please post your code  :)

1 person likes this

Share this post


Link to post
Share on other sites
15 hours ago, mikell said:

Hum probably mLipok's comment meant also : please post your code  :)

 

I can send you one archive includes photographs should run continuously .PNG format

15 hours ago, mikell said:

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I'm Polish.
I'm using Google Translate too (very often, but less and less - matter of practice).

Just you must try to use other wording, and try to organize them in horizontal not vertical statement.

 

@mikell is quite right.

If you had problem with english try to use AutoIt language to describe what you want to do.
Of course you must add comments to your example code.

 

btw.
In this case combination of AutoIt+English is much more universal language in comparition to English ;)

 

EDIT2:

If you want a good use GOOGLE Translate

then you need to do multiple translation.
VIETNAMESE> ENGLISH> VIETNAMESE

Then you'll see what others see (those reading)

Edited by mLipok
1 person likes this

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites
15 hours ago, mLipok said:

I'm Polish.
I'm using Google Translate too.

Just you must try to use other wording, and try to organize them in horizontal not vertical statement.

 

@mikell is quite right.

If you had problem with english try to use AutoIt language to describe what you want to do.
Of course you must add comments to your example code.

 

btw.
In this case combination of AutoIt+English is much more universal language in comparition to English ;)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Icons.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)

$ANIMATED = GUICtrlCreatePic("", 30, 30, 264, 90)
_SETIMAGE(-1, @ScriptDir & "\REZ_Systems\UI\UI_BI_FX\BI_FX001.PNG")
GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###
$time = TimerInit()
$id_gui = 1
While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
      Case $GUI_EVENT_CLOSE
         Exit

   EndSwitch
   If TimerDiff($time) > 70 Then ; 3s loading image
      $id_gui += 1
      If $id_gui = 52 Then $id_gui = 1
      $time = TimerInit()
      _SETIMAGE($ANIMATED,@ScriptDir & "\REZ_Systems\UI\UI_BI_FX\BI_FX0" & $id_gui & ".PNG")
   EndIf
WEnd
 

aaUntitled.png

Share this post


Link to post
Share on other sites

Please read this:

 How to post code on the forum 

1 person likes this

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

 

I run it smoothly

Share this post


Link to post
Share on other sites

Hmm, your operating system is in English but you don't understand English.

 

Maybe you can provide also the images in a zip archive.

1 person likes this

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
15 hours ago, UEZ said:

Hmm, your operating system is in English but you don't understand English.

 

Maybe you can provide also the images in a zip archive.

 

15 hours ago, mLipok said:

Please read this:

 How to post code on the forum 

 

Sorry, I lost too polite :'(

UI_BI_FX.zip

Share this post


Link to post
Share on other sites

Ok, the animation runs properly. What is your problem now?

 

1 person likes this

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
15 hours ago, UEZ said:
15 hours ago, UEZ said:

Ok, the animation runs properly. What is your problem now?

 

 

It runs not smooth , but it kept twitching

Share this post


Link to post
Share on other sites

Try this:

#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)

$ANIMATED = GUICtrlCreatePic("", 30, 30, 264, 90)
GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

Global Const $STM_SETIMAGE = 0x0172
_GDIPlus_Startup()
Global $i, $aFrames[51]
For $i = 1 To 51
    $aFrames[$i - 1] = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\REZ_Systems\UI\UI_BI_FX\BI_FX0" & $i & ".PNG")
Next
Global $iClear = 0xFFF0F0F0
Global $hBitmap = _GDIPlus_BitmapCreateFromScan0(264, 90), $hGfx = _GDIPlus_ImageGetGraphicsContext($hBitmap)
AdlibRegister("Play_Anim", 70)


While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
       Case $GUI_EVENT_CLOSE
            AdlibUnRegister("Play_Anim")
            GUIDelete()
            For $i = 0 To 50
                _GDIPlus_ImageDispose($aFrames[$i])
            Next
            _GDIPlus_GraphicsDispose($hGfx)
            _GDIPlus_ImageDispose($hBitmap)
            _GDIPlus_Shutdown()
            Exit
   EndSwitch
WEnd

Func Play_Anim()
    Local Static $iFrame = 0
    _GDIPlus_GraphicsClear($hGfx, $iClear)
    _GDIPlus_GraphicsDrawImageRect($hGfx, $aFrames[$iFrame], 0, 0, 264, 90)
    Local $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _WinAPI_DeleteObject(GUICtrlSendMsg($ANIMATED, $STM_SETIMAGE, $IMAGE_BITMAP, $hGDIBitmap))
    _WinAPI_DeleteObject($hGDIBitmap)
    $iFrame += 1
    If $iFrame > 50 Then $iFrame = 0
EndFunc

 

2 people like this

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

@UEZ  Interesting implementation.

 

1 person likes this

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites
On 17/2/2016 at 6:13 AM, UEZ said:

Try this:

#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)

$ANIMATED = GUICtrlCreatePic("", 30, 30, 264, 90)
GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

Global Const $STM_SETIMAGE = 0x0172
_GDIPlus_Startup()
Global $i, $aFrames[51]
For $i = 1 To 51
    $aFrames[$i - 1] = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\REZ_Systems\UI\UI_BI_FX\BI_FX0" & $i & ".PNG")
Next
Global $iClear = 0xFFF0F0F0
Global $hBitmap = _GDIPlus_BitmapCreateFromScan0(264, 90), $hGfx = _GDIPlus_ImageGetGraphicsContext($hBitmap)
AdlibRegister("Play_Anim", 70)


While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
       Case $GUI_EVENT_CLOSE
            AdlibUnRegister("Play_Anim")
            GUIDelete()
            For $i = 0 To 50
                _GDIPlus_ImageDispose($aFrames[$i])
            Next
            _GDIPlus_GraphicsDispose($hGfx)
            _GDIPlus_ImageDispose($hBitmap)
            _GDIPlus_Shutdown()
            Exit
   EndSwitch
WEnd

Func Play_Anim()
    Local Static $iFrame = 0
    _GDIPlus_GraphicsClear($hGfx, $iClear)
    _GDIPlus_GraphicsDrawImageRect($hGfx, $aFrames[$iFrame], 0, 0, 264, 90)
    Local $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _WinAPI_DeleteObject(GUICtrlSendMsg($ANIMATED, $STM_SETIMAGE, $IMAGE_BITMAP, $hGDIBitmap))
    _WinAPI_DeleteObject($hGDIBitmap)
    $iFrame += 1
    If $iFrame > 50 Then $iFrame = 0
EndFunc

 

 

Thank you in advance for the code , but when you run it an error ?

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "F:\Dot Kich\Tester.au3"    
"F:\Dot Kich\Tester.au3" (50) : ==> Unknown function name.:
Global $hBitmap = _GDIPlus_BitmapCreateFromScan0(264, 90), $hGfx = _GDIPlus_ImageGetGraphicsContext($hBitmap)
Global $hBitmap = ^ ERROR
>Exit code: 1    Time: 1.951

 

Share this post


Link to post
Share on other sites
Wrong to right, I forgot to update its library so much error , your code right, thank you a lot , you really enthusiastic
 you more :)

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

Quote

In this topic , you gave me a standard source , and I should add , " this is important " that the background is transparent , and the present I do not know how handle @@ !

Handling transparent images is not easy. You have to adjust the $iClear value according to the background color.

$iClear must be in format ARGB -> AlphaRedGreenBlue

Further it is much easier to handle the color value in hex decimal format -> $iClear = 0xFFF0F0F0

Each color channel must be in the range of 0x00 until 0xFF which is in decimal 0 - 255. 0x is the prefix for hex decimal numbers.

If you clear the picture image first it will start to twitsching again.

Edited by UEZ
1 person likes this

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
18 hours ago, UEZ said:

Handling transparent images is not easy. You have to adjust the $iClear value according to the background color.

$iClear must be in format ARGB -> AlphaRedGreenBlue

Further it is much easier to handle the color value in hex decimal format -> $iClear = 0xFFF0F0F0

Each color channel must be in the range of 0x00 until 0xFF which is in decimal 0 - 255. 0x is the prefix for hex decimal numbers.

If you clear the picture image first it will start to twitsching again.

Sorry. in my project , these elements it must be transparent , what I need is not being tugged it as source code I did, I hope you help me once again , I thank you very much

:'(

Share this post


Link to post
Share on other sites

If you can provide more information about your project then maybe.

1 person likes this

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.