Jump to content

Recommended Posts

Posted

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

Posted

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. ;)

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 Forum

 

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
×
×
  • Create New...