Sign in to follow this  
Followers 0
xroot

American Flag

6 posts in this topic

The American Flag or Old Glory by Oren Leavitt is way to cool.

Written in C++ I wanted to put it in AU3 and finally got around to it.

Very interesting calculations on drawing the stars.

Press Esc key to quit.

Do check it out see what you think, and always have fun.

AFlag.zip

Share this post


Link to post
Share on other sites



The American Flag or Old Glory by Oren Leavitt is way to cool.

Written in C++ I wanted to put it in AU3 and finally got around to it.

Very interesting calculations on drawing the stars.

Press Esc key to quit.

Do check it out see what you think, and always have fun.

So nice with so many calculations. ;)


When the words fail... music speaks

Share this post


Link to post
Share on other sites

Way Cool! Thanks

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Hi

Wow, many calcs ;)

Here is one shorter version wich showing the german flag. Easy contrary to US Flag, isnt it? :D

#include<GDIPlus.au3>

$hWnd = GUICreate("Flag", @DesktopWidth, @DesktopHeight, 0, -2, 0x80000000,0x08);Popup,topmost
_GDIPlus_Startup()
$hPen = False
GUISetState()
$hGraph = _GDIPlus_GraphicsCreateFromHWND($hWnd)
For $i = 1 To @DesktopHeight
    If $i <= @DesktopHeight / 3 Then
        If Not $hPen Then $hPen = _GDIPlus_PenCreate(0xff000000)
        _GDIPlus_GraphicsDrawLine($hGraph, 0, $i, @DesktopWidth, $i, $hPen)
        If $i = @DesktopHeight / 3 Then $hPen = Not _GDIPlus_PenDispose($hPen)
    ElseIf $i <= (@DesktopHeight / 3) * 2 Then
        If Not $hPen Then $hPen = _GDIPlus_PenCreate(0xffff0000)
        _GDIPlus_GraphicsDrawLine($hGraph, 0, $i, @DesktopWidth, $i,$hPen)
        If $i = @DesktopHeight / 3 * 2 Then $hPen = Not _GDIPlus_PenDispose($hPen)
    ElseIf $i <= (@DesktopHeight / 3) * 3 Then
        If Not $hPen Then $hPen = _GDIPlus_PenCreate(0xffffff00)
        _GDIPlus_GraphicsDrawLine($hGraph, 0, $i, @DesktopWidth, $i,$hPen)
    EndIf
Next

While 1
    If GUIGetMsg() = -3 Then Exit _GDIPlus_GraphicsDispose($hGraph)
WEnd

For sure you can also use _GDIPlus_GraphicsDrwaRect, but this is too easy^^

Edited by GtaSpider

www.AutoIt.de - Moderator of the German AutoIt Froum

Share this post


Link to post
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
Sign in to follow this  
Followers 0