Jump to content

Speed-up AutoIt using FreeBasic


UEZ
 Share

Recommended Posts

  • 2 weeks later...

Thanks wakillon.

 

FreeBasic has similar syntax as AutoIt. So it's not very hard to learn the "basics".

 

Btw, since some days I'm writing a DLL for image filter effects (SymmetricNearestNeighbour, Jitter, Median, Kuwahara, Convolution, etc.) which I will release soon.

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

@UEZ ,

Did you use any step by step tutorals or any books. I have installed FB but i didn't even started learning.

Spoiler

My Contributions

Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language.

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to comment
Share on other sites

3 minutes ago, kcvinu said:

@UEZ ,

Did you use any step by step tutorals or any books. I have installed FB but i didn't even started learning.

Only a small tutorial written by eukalyptus how to create a DLL using FB. It's in German only.

Edited by UEZ

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Oops !.. Anyway, i am going to start with basics. I have a book named "A beginer's guide to freebasic" byRichard D clark and Ebben feagan. 

Spoiler

My Contributions

Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language.

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to comment
Share on other sites

Hi GDI King :thumbsup:

When i compile Plasma Variante 5 with FB Editor i get a warning : 

warning 1(1): Passing different pointer types, at parameter 2 of GDIPCREATESOLIDFILL()

So, why use @hBrush instead of hBrush ? :huh2:

Edit : i use FbEdit FreeBASIC code editor v 1.0.6.8 (Last Update: 2016-03-19)

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

These are warnings only. Currently I'm not able to answer what to do to get rid of these warnings.

As far as I understood the @ char is the address in the memory.

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

This might solve the warning problems:

 

GDI+ Plasma v5 Booster:

'coded by UEZ build 2016-06-23 beta
#Include Once "win\gdiplus.bi"
#Include Once "crt\math.bi"
Using GDIPLUS

Extern "Windows-MS"


Function Dist(a As Single, b As Single, c As Single, d As Single) As Single
    Return Sqrt((a - c) * (a - c) + (b - d) * (b - d))
End Function

Sub Boost(ByVal hCanvas as Any Ptr, iSizeW As Long, iSizeH As Long, iW As Long, iH As Long, fTime As Single) Export
    
    Dim As Long iX, iY, iARGB
    Dim As Single cx, cy, v, f1, fDist
    Const Pi As Double = 3.1415926535897932
    Dim As Any Ptr hBrush
    
    For iY = 0 To iH - iSizeH Step iSizeH
        For iX = 0 To iW - iSizeW Step iSizeW
            
            fDist = Dist(fTime * 1.5, iX, iY, 32)
            cx = iX + 128 * Sin(fDist / 48)
            fDist = Dist(iY, 128, fTime * 2.5, 8)
            cy = iY + 92 * Cos(fDist / 32)
            v = Cos(Sqrt(cx * cx + cy * cy) / 512 + fTime)
            f1 = v * Pi
            iARGB = &hFF000000 + &h10000 * Int(Abs(Cos(f1 / 2)) * &hFF) + &h100 * Int(Abs(Sin(f1 * 2)) * &hFF) + Int(Abs(Cos(f1 / 1.5)) * &hFF)

            GdipCreateSolidFill(iARGB, @hBrush)
            GdipFillRectangle(hCanvas, hBrush, iX, iY, iSizeW, iSizeH)
            GdipDeleteBrush(hBrush)

        Next
    Next
End Sub

End Extern

 

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 1 month later...

Here another example AutoIt vs FreeBasic:

 

FB: 25.000 Partikel @ 1024x768
Au3: 1.000 Partikel @ 800x600.

 

Download source + compiled exes: Particles Mouse Attraction - Au3 vs FB.zip

 

Just move your mouse around on the GUI...

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

8 hours ago, spudw2k said:

Holy crap that's fast...makes me want to redo my Plasma_Kit in FB.  Cool stuff!

Try it and you will get new ideas what to code. ;)

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 4 weeks later...
3 hours ago, qwert said:

@UEZ: very interesting line of development.  Thanks for posting.  If and when you add any other examples, a "latest and greatest" ZIP of everything together would be much appreciated. 

Added a 7-Zip archive with all examples from post #1 and some more. ;)

 

Check out post #1.

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...