Jump to content

prospeed


jpam
 Share

Recommended Posts

Here you go !

you need to download new prospeed udf.

#include <GUIConstants.au3>
#include <prospeed.au3>

HotKeySet("{Esc}","_exit")
Opt("GUIOnEventMode", 1)

$gui = GUICreate("",350,500)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUISetState()

$hdc = GetHDC()

;Curve($S_Destination, $Start_X, $Start_Y, $mid_X, $mid_Y, $end_X, $end_Y, $S_Color, $S_LineWidth)
Curve($hdc, 50, 50, 100, 50, 150, 100, 0xff0000, 4)

Curve($hdc, 150, 150, 200, 220, 150, 200, 0x0000ff, 10)

While 1
    Sleep(1000)
WEnd
    
Func _exit()
    Exit
EndFunc
Link to comment
Share on other sites

  • Replies 511
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Just watched the New Demo.... totally awesome! love the voiceover as well. :D

I`m amazed how much work you have put into this thing!

I can now play my amiga soundtracker collection using autoit with the FMod.au3 include.

(Playing childmix.s3m as I type this... :( )

Thank You! :)

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

Thanks a lot jpam,

Although i use now the GDI ARC, you helped me a lot to understand some aspects of the whole DC anf BMP thing, what prospeed is all about.

I noticed one thing: if you didnt worked with GDI before, its very hard to get an idea how it works, even when you look at the examples you provide and do lots of trial/erroring.

Create which buffer? CopyExtBmp to what? I already understand most of those now.

But till today i dont exactly get why you use two buffers for painting ($S_fensterkopie1/2) one for the sprites, one for the background?

What exactly are BMP Arrays and what can you do with them?

I read the German pdf of prospeed.dll (im also German) but although its very extended i couldnt find exactly the answers what i looked for.

Besides of this i use prospeed for a big project of mine. To that day, i had problems with the backgroundbuffer, which gave me crappy picture artifacts and garbage painting.

But now i try to get rid of that and make a professional solution.

I have some problems:

  • If you set the prospeed $hdc to a piccontrol which lays in an TabItem control, i think you have the problem that first the prospeed painting is done and after that, the Tabitem is painted. You can see this behavior when you move a window over the GUI and move it quickly out. Sometimes even the whole background is gone.
  • The WM_Paint is not fired (or too early fired) when i change the tabs. I constructed a workaround by using WM_NOTIFY and set $Gui_Repaint = 1 which causes later Repainting in the main loop. Also with WM_ACTIVATE (If you move another window half over the prospeedwindow and then bring it to front). As you can see, this can take a longer time, if you have a work intensive Script, I better want to use WM_PAINT for this. Do you have any idea?

    I could use PaintNew_2() in the Sub Main Loop, but that gives me flickering ofthe sprites the whole time.

  • I want to have a separate Buffer for colored Circles. I didnt figured out yet, how to draw GDI stuff into an buffer, BMP's dot work and Array's (ExtBMP) dont work, although i have a guess that im quite near to the solution.

This is the Script so far (a heavily striped down version of my original script, which has 7k lines :)

Its good example how you can implement prospeed into your GUI.

Sidenotes: I use my own Background, loadsprite and PaintNew() functions.

If you dont see any image, jsut reload the script, InetGet may take some time

#include <GUIConstants.au3>
#include <prospeed.au3>
#Include <GuiTab.au3>


HotKeySet("{Esc}","_exit")

Opt("GUIOnEventMode", 1)
Opt("GUICloseOnESC", 0)




$gdidll = DllOpen("gdi32.dll")


if not FileExists("Image1.jpg") then  InetGet("http://qsek.qs.funpic.de/Image1.jpg","Image1.jpg")
if not FileExists("Image2.jpg") then  InetGet("http://qsek.qs.funpic.de/Image2.jpg","Image2.jpg")
if not FileExists("Image3.jpg") then  InetGet("http://qsek.qs.funpic.de/Image3.jpg","Image3.jpg")
if not FileExists("Sprites.gif") then  InetGet("http://qsek.qs.funpic.de/Sprites.gif","Sprites.gif")


dim $pic[3]
$pic[0]= "Image1.jpg"
$pic[1] = "Image2.jpg"
$pic[2] = "Image3.jpg"

$Bee = _loadsprite ("Sprites.gif", 1) ; 1= Array parameter, return Sprite informations as Array
; returns Spriteinformations: $SelS[3] = [$S_Spriteplane[0], $S_W, $S_H]

$SelSprite = ""

$backpic = ""

$Gui_Repaint = 0

#region ### START Koda Main GUI
$GUI = GUICreate("Form2", 462, 455, 271, 230)
GUISetState(@SW_SHOW,$Gui)
GUISetState(@SW_LOCK,$Gui)

    #region ### START Koda Sub GUI
    ; #### Sub GUI Window for second Tab #####
    $Gui_VIOLSWIN = GUICreate("", 270, 270, 145, 155, $WS_CHILD, -1, $Gui)
        ;### Tab Control
        $TAB2 = GUICtrlCreateTab(0, 0, 295, 270)
        ; --## Main Viols
            $Gui_VIOLMAIN = GUICtrlCreateTabItem("Sub1")
                GUICtrlCreateGroup("Main", 10, 30, 240, 230)
            $Gui_VIOLSP = GUICtrlCreateTabItem("Sub2")
                GUICtrlCreateGroup("Is All", 10, 130 - 100, 240, 200)
                    $OPT_BRexcludeAA = GUICtrlCreateCheckbox("Test Text", 20, 50, 100, 20, BitOR($BS_CHECKBOX, $BS_AUTOCHECKBOX, $WS_TABSTOP))
        GUICtrlCreateTabItem("")
    
    GUISetState(@SW_HIDE, $Gui_VIOLSWIN)
    #Endregion ### End Koda Sub GUI

;       #######;;;...       Continue Main GUI   ...;;;#######       ----------
GUISwitch($Gui)




$ListView1 = GUICtrlCreateListView("", 14, 17, 115, 218)
$ListView2 = GUICtrlCreateListView("", 136, 16, 298, 104)
$Tab1 = GUICtrlCreateTab(135, 127, 302, 302)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

; ######  Main Tab Ctrl ######
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
    $PROSPEED = GUICtrlCreatePic("", 145, 155, 300, 300) ; Prospeed Tab
    GUICtrlSetState(-1,$GUI_SHOW)
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
    ; > Sub Tab GUI <
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
    $Button1 = GUICtrlCreateButton("Button1", 152, 250, 120, 52, 0)
    $Label1 = GUICtrlCreateLabel("Label1", 157, 180, 36, 17)
GUICtrlCreateTabItem("")

;  ##### Misc Buttons ######
$Button2 = GUICtrlCreateButton("Next Pic", 17, 273, 110, 33, 0)
GUICtrlSetOnEvent(-1, "_NextPic")
$Button3 = GUICtrlCreateButton("PaintNew", 17, 320, 110, 33, 0)
GUICtrlSetOnEvent(-1, "PaintNew")
$Button4 = GUICtrlCreateCheckbox("Show Circles", 17, 360, 110, 33,$BS_PUSHLIKE)
GUICtrlSetOnEvent(-1, "_ShowCircles")


$Label2 = GUICtrlCreateLabel("Label2", 16, 245, 36, 17)

GUICtrlSetState($TABSHEET1, $Gui_SHOW)
GUISetState(@SW_UNLOCK,$Gui)
GUISetState(@SW_SHOW)

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



GUIRegisterMsg($WM_NOTIFY, "MY_WM_NOTIFY")
GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
GUIRegisterMsg ( $WM_ACTIVATE, "MY_WM_ACTIVATE" )
GUISetOnEvent($Gui_EVENT_CLOSE, "_Exit", $Gui)
GUIRegisterMsg(0x000F, "PaintNew_2")


HotKeySet("{pause}", "_NextPic")
HotKeySet("{SCROLLLOCK}", "PaintNew")



$s = 0
Dim $SelSprite[11]
$posx = ""
$posy = ""



$circleBuffer = CreateExtBmp(250, 250) ; Create Memory Bmp for Circles ; dont work

$circle = CreateExtFX(250, 250) ; i suppose to use an Array to paint in but also dont work
$e = 0

$backpic = _Background($pic[$e], 0, 0, 250, 250, $GUI,$prospeed) ; init Background / $hdc

_NextPic() ; Change to first Background

; Main Loop
while 1
    
    If $Gui_Repaint then
        $Gui_Repaint = 0
        ConsoleWrite("RePaint" & @CRLF)
        PaintNew() ; Main Loop, every ~3000 ms
    endif
    
    ; Sub Sprite Move Loop
    for $z = 0 to 20
        $s += 1
        if $s > 9 then $s = Random (0,10,1)
        if $backpic then
            Global $posx = Random(50,200,1)
            Global $posy = Random(50,200,1)
            if not $SelSprite[$s] then ; Sprite Init
                ConsoleWrite("Creating Sprite" & @CRLF)
                $SelSprite[$s] = sprite($Bee[0],0, 0, 24, 18, 4, 1, 6, $posx,$posy)
                SetSpriteSpeed ($SelSprite[$s], 1, 1)
                SetSpriteMovingMode($SelSprite[$s], 1)
            else ; Sprite set continous coords
            Endif
            ConsoleWrite("Move to "&$posx&","&$posy& @CRLF)
            Movesprite($SelSprite[$s], $posx, $posy)
        Endif
    
        sleep(100) ; this equals code with some calculations
        ;###### Code #####
    next
    
    
    ;###### Code #####
    sleep(2000) ; this equals code with lots of calculations
    
wend

func _NextPic()

    if $backpic then FreeExtBmp($backpic) ; delete previous Background (got to have $backpic stay in memory so i can restore the org Background after show cirlces turned off)
    $backpic = LoadExtImage($pic[$e]) ; load next Background into memory
    
    CopyExtBmp($hdc, 0, 0, 250, 250, $backpic, 0, 0, 0) ; Copy Memory to PicControl
    
    SetBuffer($backpic) ; Set the Background to the Backgroundbuffer
    
    $e += 1
    if $e > 2 then $e = 0
EndFunc

Func _ShowCircles()
    If GUICtrlRead($Button4) = $Gui_CHECKED then
        ConsoleWrite("Show Circles" & @CRLF)
        $rnd_color = "0x"&hex(Random(0,255,1),2)&hex(Random(0,255,1),2)&hex(Random(0,255,1),2)
        
        _GDI_Arc ($hdc, Random(50,200,1), Random(50,200,1), Random(10,50,1), Random(1,10,1), $rnd_color) ; as you can see this copies the background and Sprites too. How to draw just the Circles in a memory bitmap and use this as independent Buffer/Layer?
        SetBuffer($hdc)
        
;~      _GDI_Arc ($circle, Random(50,200,1), Random(50,200,1), Random(10,50,1), Random(1,10,1), $rnd_color) ; this draws nothing
;~      CopyArray($circleBuffer,0,0, $circle) ; this draws nothing
;~      SetBuffer($circleBuffer) ; this draws nothing

        
    else
        ConsoleWrite("Hide Circles" & @CRLF)
        CopyExtBmp($hdc, 0,0,250,250,$backpic,0,0,0)
        SetBuffer($backpic)
    endif
EndFunc


Func PaintNew_2()
    ConsoleWrite("pro: paintnew()" & @CRLF)
    DllCall($S_DLL, "long", "CopyExtBmp", _
                    "long", $hDC, _
                    "long", 0, _
                    "long", 0, _
                    "long", $S_WIDTH[0], _
                    "long", $S_HEIGHT[0], _
                    "long", $S_fensterkopie1[0], _
                    "long", 0, _
                    "long", 0, _
                    "long", 0)
    DllCall($S_DLL, "long", "CopyExtBmp", _
                    "long", $hDC, _
                    "long", 0, _
                    "long", 0, _
                    "long", $S_WIDTH[0], _
                    "long", $S_HEIGHT[0], _
                    "long", $S_fensterkopie2[0], _
                    "long", 0, _
                    "long", 0, _
                    "long", 0)
    ; Supposed Buffer/Layer for Circles
    DllCall($S_DLL, "long", "CopyExtBmp", _
                    "long", $hDC, _
                    "long", 0, _
                    "long", 0, _
                    "long", $S_WIDTH[0], _
                    "long", $S_HEIGHT[0], _
                    "long", $circleBuffer, _
                    "long", 0, _
                    "long", 0, _
                    "long", 0)
EndFunc


func _GDI_Arc ($tmp_hdc, $X, $Y, $Rad, $Width, $Color); $X= Midpoint X coord, $Y= Midpoint Y coord, $Rad= Radius

    local $Xleft = $X - $rad, $Ytop = $Y - $rad, $Xright = $X + $rad, $Ybottom = $Y + $rad
    
    local $Xstart = 0 , $YStart = 0, $XEnd = 0, $YEnd = 0


    local $S_pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0, "int", $width, "int", $Color)
    DllCall("gdi32.dll", "int", "SelectObject", "int", $tmp_hdc, "int", $S_pen[0])
    DLLCall($gdidll ,"int","Arc", _
                        "hwnd", $tmp_hdc, _
                        "int" , $Xleft, _
                        "int" , $Ytop, _
                        "int" , $Xright, _
                        "int" , $Ybottom, _
                        "int" , $Xstart, _
                        "int" , $YStart, _
                        "int" , $XEnd, _
                        "int" , $YEnd)
    DllCall("gdi32.dll", "int", "DeleteObject", "hwnd", $S_pen)
        
endfunc


Func MY_WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam)

    #forceref $hWndGUI, $MsgID, $wParam
    Local $tagNMHDR, $event
    Local $nID = _LoWord($wParam)
    $tagNMHDR = DllStructCreate("int;int;int", $lParam)
    If @error Then Return
    $event = DllStructGetData($tagNMHDR, 3)

    If $event = $TCN_SELCHANGE and $nID = $Tab1 Then
;~      ConsoleWrite("Event" & @CRLF)
        $cur_Tab = _GUICtrlTab_GetCurSel($Tab1)


        if $cur_Tab = 1 then
            GUISetState(@SW_SHOW ,$Gui_ViolsWin)
        else
            GUISetState(@SW_HIDE ,$Gui_ViolsWin)
        endif
        
        if $cur_Tab = 0 then
            ConsoleWrite("$Gui_Repaint" & @CRLF)
            $Gui_Repaint = 1
;~          PaintNew_2()
        else
;~          ConsoleWrite("Hide" & @CRLF)
        endif

    endif

    Return $Gui_RUNDEFMSG
EndFunc

Func MY_WM_ACTIVATE($HWND, $MSG, $WPARAM, $LPARAM)
;~  PaintNew() ; doesent work
    $Gui_Repaint = 1
EndFunc 




; Altered Background UDF
Func _Background($S_FILE, $S_POSX, $S_POSY, $N_WIDTH, $N_HEIGHT, $AM_WIN_HANDLE = "",$S_CTRL_ID = "")

    if $AM_WIN_HANDLE then ; if defined
        if $S_CTRL_ID <> "" then ; if defined
            $WIN_GETHANDLE = ControlGetHandle ( $AM_WIN_HANDLE, "", $S_CTRL_ID ); assign the background buffers to a controlhandle in the window (e.g. piccontrol)
        Else
            $WIN_GETHANDLE = $AM_WIN_HANDLE;  assign the background buffers direct to a Windowhandle
        endif
    Else ; else proceed as normal (Assign the buffer to current active window)
        $WIN_TITLE     = WinGetTitle("", "")
        $WIN_GETHANDLE = WinGetHandle($WIN_TITLE, "")
    endif
    
    $RAW_HDC       = DllCall("user32.dll", "ptr", "GetDC", "hwnd", $WIN_GETHANDLE)
    $hDC           = "0x" & Hex($RAW_HDC[0])
    
    $S_background = DllCall($S_DLL, "long", "LoadExtImage", "str" ,$S_FILE) 
    $S_WIDTH      = DllCall($S_DLL, "long", "GetBmpWidth" , "long",$S_background[0])
    $S_HEIGHT     = DllCall($S_DLL, "long", "GetBmpHeight", "long",$S_background[0])

    
    $C_createBMP = DllCall($S_dll, "long", "CreateExtBmp", "long", $hDC, "long", $N_WIDTH, "long", $N_HEIGHT)       
    DllCall($S_dll,"long","SizeExtBmp", "long",$C_createBMP[0], _
                                        "long",0, _
                                        "long",0, _
                                        "long",$N_WIDTH, _
                                        "long",$N_HEIGHT, _
                                        "long",$S_background[0], _
                                        "long",0, _
                                        "long",0, _
                                        "long",$S_WIDTH[0], _
                                        "long",$S_HEIGHT[0], _
                                        "long",0)
    DllCall($S_DLL, "long", "CopyExtBmp", "long",$hdc, _
                                          "long",0, _
                                          "long",0, _
                                          "long",$N_WIDTH, _
                                          "long",$N_HEIGHT, _
                                          "long",$C_createBMP[0], _
                                          "long",0, _
                                          "long",0, _
                                          "long",0)
    $S_fensterkopie1 = DllCall($S_DLL, "long", "CreateExtBmp", "long", $hDC, "long", $N_WIDTH, "long", $N_HEIGHT)
    $S_fensterkopie2 = DllCall($S_DLL, "long", "CreateExtBmp", "long", $hDC, "long", $N_WIDTH, "long", $N_HEIGHT)
    DllCall($S_DLL, "long", "CopyExtBmp", "long", $S_fensterkopie1[0], _
                                          "long",0, _
                                          "long",0, _
                                          "long",$N_WIDTH, _
                                          "long",$N_HEIGHT, _
                                          "long",$hDC, _
                                          "long",0, _
                                          "long",0, _
                                          "long",0)
    DllCall($S_DLL, "long", "CopyExtBmp", "long", $S_fensterkopie2[0], _
                                          "long",0, _
                                          "long",0, _
                                          "long",$N_WIDTH, _
                                          "long",$N_HEIGHT, _
                                          "long",$hDC, _
                                          "long",0, _
                                          "long",0, _
                                          "long",0)     
    $S_WIDTH[0]  = $N_WIDTH
    $S_HEIGHT[0] = $N_HEIGHT
    Return $C_createBMP[0]
EndFunc

; Altered loadsprite UDF
Func _loadsprite($S_SPRITE_PIC, $getarr = 0)
    $S_Spriteplane = DllCall($S_DLL, "long", "LoadExtImage", "str", $S_SPRITE_PIC)
    
    if not $getarr = 0 then 
        $S_WIDT  = DllCall($S_DLL, "long", "GetBmpWidth", "long", $S_Spriteplane[0])
        $S_HEIGH = DllCall($S_DLL, "long", "GetBmpHeight", "long", $S_Spriteplane[0])
        $S_W = $S_WIDT[0]
        $S_H = $S_HEIGH[0]
;~      MsgBox(0,0,$S_W&", "&$S_H)
        Dim $arr[3] = [$S_Spriteplane[0], $S_W, $S_H]
        Return $arr
    Else
        Return $S_Spriteplane[0]
    EndIf
Endfunc


Func MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam)

    Local $nNotifyCode = _HiWord($wParam)
    Local $nID = _LoWord($wParam)
    Local $hCtrl = $lParam

    Switch $nID
        Case $Tab1
            ConsoleWrite($nNotifyCode & @CRLF)

        Case Else
            ConsoleWrite("$nId=" & $nID & @LF)
    EndSwitch
    Return $Gui_RUNDEFMSG
EndFunc

Func _exit()
    FreeAllExtBmps()
    DllClose($gdidll)
    Exit
EndFunc


Func _HIWORD($X)
    Return BitShift($X, 16)
EndFunc   ;==>_HIWORD


Func _LOWORD($X)
    Return BitAND($X, 65535)
EndFunc   ;==>_LOWORD
Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite
Link to comment
Share on other sites

hope that this helps you,

i have put comments after the functions

#include <GUIConstants.au3>
#include <prospeed.au3>
#Include <GuiTab.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>

HotKeySet("{Esc}","_exit")

Opt("GUIOnEventMode", 1)
Opt("GUICloseOnESC", 0)

$gdidll = DllOpen("gdi32.dll")

if not FileExists("Image1.jpg") then  InetGet("http://qsek.qs.funpic.de/Image1.jpg","Image1.jpg")
if not FileExists("Image2.jpg") then  InetGet("http://qsek.qs.funpic.de/Image2.jpg","Image2.jpg")
if not FileExists("Image3.jpg") then  InetGet("http://qsek.qs.funpic.de/Image3.jpg","Image3.jpg")
if not FileExists("Sprites.gif") then  InetGet("http://qsek.qs.funpic.de/Sprites.gif","Sprites.gif")

dim $pic[3]
$pic[0] = "Image1.jpg"
$pic[1] = "Image2.jpg"
$pic[2] = "Image3.jpg"

$Bee = _loadsprite ("Sprites.gif", 1) ; 1= Array parameter, return Sprite informations as Array
; returns Spriteinformations: $SelS[3] = [$S_Spriteplane[0], $S_W, $S_H]

$SelSprite = ""

$backpic = ""

$Gui_Repaint = 0

#region ### START Koda Main GUI
$GUI = GUICreate("Form2", 462, 455, 271, 230)
GUISetState(@SW_SHOW,$Gui)
GUISetState(@SW_LOCK,$Gui)

    #region ### START Koda Sub GUI
    ; #### Sub GUI Window for second Tab #####
    $Gui_VIOLSWIN = GUICreate("", 270, 270, 145, 155, $WS_CHILD, -1, $Gui)
        ;### Tab Control
        $TAB2 = GUICtrlCreateTab(0, 0, 295, 270)
        ; --## Main Viols
            $Gui_VIOLMAIN = GUICtrlCreateTabItem("Sub1")
                GUICtrlCreateGroup("Main", 10, 30, 240, 230)
            $Gui_VIOLSP = GUICtrlCreateTabItem("Sub2")
                GUICtrlCreateGroup("Is All", 10, 130 - 100, 240, 200)
                    $OPT_BRexcludeAA = GUICtrlCreateCheckbox("Test Text", 20, 50, 100, 20, BitOR($BS_CHECKBOX, $BS_AUTOCHECKBOX, $WS_TABSTOP))
        GUICtrlCreateTabItem("")
    
    GUISetState(@SW_HIDE, $Gui_VIOLSWIN)
    #Endregion ### End Koda Sub GUI

;      #######;;;...    Continue Main GUI ...;;;#######        ----------
GUISwitch($Gui)

$ListView1 = GUICtrlCreateListView("", 14, 17, 115, 218)
$ListView2 = GUICtrlCreateListView("", 136, 16, 298, 104)
$Tab1 = GUICtrlCreateTab(135, 127, 302, 302)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlSetOnEvent(-1, "PaintNew") ; added GUICtrlSetOnEvent for tab control with paintnew() as function call
; ######  Main Tab Ctrl ######
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
    $PROSPEED = GUICtrlCreatePic("", 145, 155, 300, 300) ; Prospeed Tab
    GUICtrlSetState(-1,$GUI_SHOW)
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
    ; > Sub Tab GUI <
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
    $Button1 = GUICtrlCreateButton("Button1", 152, 250, 120, 52, 0)
    $Label1 = GUICtrlCreateLabel("Label1", 157, 180, 36, 17)
GUICtrlCreateTabItem("")

;  ##### Misc Buttons ######
$Button2 = GUICtrlCreateButton("Next Pic", 17, 273, 110, 33, 0)
GUICtrlSetOnEvent(-1, "_NextPic")
$Button3 = GUICtrlCreateButton("PaintNew", 17, 320, 110, 33, 0)
GUICtrlSetOnEvent(-1, "PaintNew")
$Button4 = GUICtrlCreateCheckbox("Show Circles", 17, 360, 110, 33,$BS_PUSHLIKE)
GUICtrlSetOnEvent(-1, "_ShowCircles")

$Label2 = GUICtrlCreateLabel("Label2", 16, 245, 36, 17)

GUICtrlSetState($TABSHEET1, $Gui_SHOW)
GUISetState(@SW_UNLOCK,$Gui)
GUISetState(@SW_SHOW)

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

GUISetOnEvent($Gui_EVENT_CLOSE, "_Exit", $Gui)

HotKeySet("{pause}", "_NextPic")
HotKeySet("{SCROLLLOCK}", "PaintNew")

$s = 0
Dim $SelSprite[11]
$posx = ""
$posy = ""

$e = 0

$backpic = LoadExtImage($pic[$e])
$hdc = CtrlGetDC($PROSPEED) ; get controlDC for sprites and pictures
CopyExtBmp($hdc, 0, 0, 250, 250, $backpic, 0, 0, 0) ; copy picture to tab control

CreateBuffer(250,250) ; create screenbuffer for wm_paint and sprites
SetBuffer($hdc) ; set buffer, copy the contents of hdc into screenbuffer

_NextPic() ; Change to first Background

; Main Loop
while 1
    ; Sub Sprite Move Loop
    for $z = 0 to 20
        $s += 1
        if $s > 9 then $s = Random (0,10,1)
        if $backpic then
            Global $posx = Random(50,200,1)
            Global $posy = Random(50,200,1)
            if not $SelSprite[$s] then ; Sprite Init
                ConsoleWrite("Creating Sprite" & @CRLF)
                SetBuffer($backpic) ; set buffer , copy picture to screenbuffer for wm_paint and sprites
                $SelSprite[$s] = sprite($Bee[0], 0, 0, 24, 18, 4, 1, 6, $posx,$posy)
                SetSpriteSpeed ($SelSprite[$s], 1, 1)
                SetSpriteMovingMode($SelSprite[$s], 1)
            else ; Sprite set continous coords
            Endif
            ConsoleWrite("Move to "&$posx&","&$posy& @CRLF)
            Movesprite($SelSprite[$s], $posx, $posy)
        Endif
    
        sleep(100) ; this equals code with some calculations
        ;###### Code #####
    next

    ;###### Code #####
    sleep(2000) ; this equals code with lots of calculations
wend

func _NextPic()
    $backpic = LoadExtImage($pic[$e]) ; load next Background into memory
    
    $w = GetBmpWidth($backpic) ; get width of picture, because the downloaded  pictures have diferent sizes
    $h = GetBmpHeight($backpic) ; get height of picture
    $tmp = CreateExtBmp(250,250) ; create empty bitmap 
    Size($tmp, 0, 0, 250, 250, $backpic, 0, 0, $w, $h, 0) ; resize picture to fit to control
    FreeExtBmp($backpic) ; free backpic , we need a new one
    $backpic = CreateExtBmp(250, 250) ; create empty bitmap
    CopyExtBmp($backpic, 0, 0, 250, 250, $tmp, 0, 0, 0) ; copy tmp bitmap with resized picture to empty bitmap
    FreeExtBmp($tmp) ; free tmp bitmap, not needed anymore
    CopyExtBmp($hdc, 0, 0, 250, 250, $backpic, 0, 0, 0) ; copy new backpic with resized picture to tab control
    SetBuffer($backpic) ; setbuffer , copy new backpic to screenbuffer for wm_paint and sprites
    
    $e += 1
    if $e > 2 then $e = 0
EndFunc

Func _ShowCircles()
    If GUICtrlRead($Button4) = $Gui_CHECKED then
        ConsoleWrite("Show Circles" & @CRLF)
        $rnd_color = "0x"&hex(Random(0,255,1),2)&hex(Random(0,255,1),2)&hex(Random(0,255,1),2)
        $tmp = CreateExtBmp(250,250) ; create empty bitmap for circle draw
        CopyExtBmp($tmp, 0, 0, 250, 250, $backpic, 0, 0, 0) ; copy backpic into empty bitmap
        _GDI_Arc ($tmp, Random(50,200,1), Random(50,200,1), Random(10,50,1), Random(1,10,1), $rnd_color) ; draw circle to tmp bitmap
        CopyExtBmp($hdc, 0, 0, 250, 250, $tmp, 0, 0, 0) ; copy tmp bitmap with contains the backpic and new circle to tab control
        SetBuffer($tmp) ; setbuffer , copy tmp bitmap to screenbuffer for wm_paint and sprites
        FreeExtBmp($tmp) ; free tmp bitmap, not needed anymore
    else        
        ConsoleWrite("Hide Circles" & @CRLF)
        CopyExtBmp($hdc, 0, 0, 250, 250, $backpic, 0, 0, 0) ; copy orginale backpic to tab control
        SetBuffer($backpic) ; setbuffer , copy orginale backpic to screenbuffer for wm_paint and sprites
    endif
EndFunc

func _GDI_Arc ($tmp_hdc, $X, $Y, $Rad, $Width, $Color); $X= Midpoint X coord, $Y= Midpoint Y coord, $Rad= Radius
    local $Xleft = $X - $rad, $Ytop = $Y - $rad, $Xright = $X + $rad, $Ybottom = $Y + $rad
    local $Xstart = 0 , $YStart = 0, $XEnd = 0, $YEnd = 0
    local $S_pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0, "int", $width, "int", $Color)
    DllCall("gdi32.dll", "int", "SelectObject", "int", $tmp_hdc, "int", $S_pen[0])
    DLLCall($gdidll ,"int","Arc", _
                        "hwnd", $tmp_hdc, _
                        "int" , $Xleft, _
                        "int" , $Ytop, _
                        "int" , $Xright, _
                        "int" , $Ybottom, _
                        "int" , $Xstart, _
                        "int" , $YStart, _
                        "int" , $XEnd, _
                        "int" , $YEnd)
    DllCall("gdi32.dll", "int", "DeleteObject", "hwnd", $S_pen)
endfunc

; Altered loadsprite UDF
Func _loadsprite($S_SPRITE_PIC, $getarr = 0)
    $S_Spriteplane = DllCall($S_DLL, "long", "LoadExtImage", "str", $S_SPRITE_PIC)
    
    if not $getarr = 0 then 
        $S_WIDT  = DllCall($S_DLL, "long", "GetBmpWidth", "long", $S_Spriteplane[0])
        $S_HEIGH = DllCall($S_DLL, "long", "GetBmpHeight", "long", $S_Spriteplane[0])
        $S_W = $S_WIDT[0]
        $S_H = $S_HEIGH[0]
;~   MsgBox(0,0,$S_W&", "&$S_H)
        Dim $arr[3] = [$S_Spriteplane[0], $S_W, $S_H]
        Return $arr
    Else
        Return $S_Spriteplane[0]
    EndIf
Endfunc

Func _exit()
    FreeAllExtBmps()
    DeleteAllSprites() ; delete all sprites, otherwise you get errors when program exit
    DllClose($gdidll)
    Exit
EndFunc

edit script typo

Edited by jpam
Link to comment
Share on other sites

a perfect working solution :)

you need to redownload prospeed.udf , i have change the sprite function a little bit

extra para $S_destination

Sprite($S_Spriteplane, $S_Destination, $S_offsetX, $S_offsetY, $S_WIDTH, $S_HEIGHT, $S_FRAMES, $S_START_FRAME, $S_FRAME_SPEED, $S_posX, $S_posY)

now you can draw sprites better to a control DC

Setbuffer() now returns pointer of current screenbuffer

#include <GUIConstants.au3>
#include <prospeed.au3>
#Include <GuiTab.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>

HotKeySet("{Esc}","_exit")

Opt("GUIOnEventMode", 1)
Opt("GUICloseOnESC", 0)

$gdidll = DllOpen("gdi32.dll")

if not FileExists("Image1.jpg") then  InetGet("http://qsek.qs.funpic.de/Image1.jpg","Image1.jpg")
if not FileExists("Image2.jpg") then  InetGet("http://qsek.qs.funpic.de/Image2.jpg","Image2.jpg")
if not FileExists("Image3.jpg") then  InetGet("http://qsek.qs.funpic.de/Image3.jpg","Image3.jpg")
if not FileExists("Sprites.gif") then  InetGet("http://qsek.qs.funpic.de/Sprites.gif","Sprites.gif")

dim $pic[3]
$pic[0] = "Image1.jpg"
$pic[1] = "Image2.jpg"
$pic[2] = "Image3.jpg"

$Bee = _loadsprite ("Sprites.gif", 1) ; 1= Array parameter, return Sprite informations as Array
; returns Spriteinformations: $SelS[3] = [$S_Spriteplane[0], $S_W, $S_H]

$SelSprite = ""

$backpic = ""

$Gui_Repaint = 0

#region ### START Koda Main GUI
$GUI = GUICreate("Form2", 462, 455, 271, 230)
GUISetState(@SW_SHOW,$Gui)
GUISetState(@SW_LOCK,$Gui)

    #region ### START Koda Sub GUI
    ; #### Sub GUI Window for second Tab #####
    $Gui_VIOLSWIN = GUICreate("", 270, 270, 145, 155, $WS_CHILD, -1, $Gui)
        ;### Tab Control
        $TAB2 = GUICtrlCreateTab(0, 0, 295, 270)
        ; --## Main Viols
            $Gui_VIOLMAIN = GUICtrlCreateTabItem("Sub1")
                GUICtrlCreateGroup("Main", 10, 30, 240, 230)
            $Gui_VIOLSP = GUICtrlCreateTabItem("Sub2")
                GUICtrlCreateGroup("Is All", 10, 130 - 100, 240, 200)
                    $OPT_BRexcludeAA = GUICtrlCreateCheckbox("Test Text", 20, 50, 100, 20, BitOR($BS_CHECKBOX, $BS_AUTOCHECKBOX, $WS_TABSTOP))
        GUICtrlCreateTabItem("")
    
    GUISetState(@SW_HIDE, $Gui_VIOLSWIN)
    #Endregion ### End Koda Sub GUI

;      #######;;;...    Continue Main GUI ...;;;#######        ----------
GUISwitch($Gui)

$ListView1 = GUICtrlCreateListView("", 14, 17, 115, 218)
$ListView2 = GUICtrlCreateListView("", 136, 16, 298, 104)
$Tab1 = GUICtrlCreateTab(135, 127, 302, 302)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlSetOnEvent(-1, "RedrawCtrl") ; added GUICtrlSetOnEvent for tab control with paintnew() as function call
; ######  Main Tab Ctrl ######
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
    $PROSPEED = GUICtrlCreatePic("", 145, 155, 250, 250) ; Prospeed Tab
    GUICtrlSetState(-1,$GUI_SHOW)
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
    ; > Sub Tab GUI <
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
    $Button1 = GUICtrlCreateButton("Button1", 152, 250, 120, 52, 0)
    $Label1 = GUICtrlCreateLabel("Label1", 157, 180, 36, 17)
GUICtrlCreateTabItem("")

;  ##### Misc Buttons ######
$Button2 = GUICtrlCreateButton("Next Pic", 17, 273, 110, 33, 0)
GUICtrlSetOnEvent(-1, "_NextPic")
$Button3 = GUICtrlCreateButton("PaintNew", 17, 320, 110, 33, 0)
GUICtrlSetOnEvent(-1, "RedrawCtrl")
$Button4 = GUICtrlCreateCheckbox("Show Circles", 17, 360, 110, 33,$BS_PUSHLIKE)
GUICtrlSetOnEvent(-1, "_ShowCircles")

$Label2 = GUICtrlCreateLabel("Label2", 16, 245, 36, 17)

GUICtrlSetState($TABSHEET1, $Gui_SHOW)
GUISetState(@SW_UNLOCK,$Gui)
GUISetState(@SW_SHOW)

$hdc = GetHDC()
GUIRegisterMsg(0x000F, "RedrawCtrl") ; GUIRegisterMsg() catch the wm_paint msg and call's RedrawCtrl() function

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

GUISetOnEvent($Gui_EVENT_CLOSE, "_Exit", $Gui)

HotKeySet("{pause}", "_NextPic")
HotKeySet("{SCROLLLOCK}", "RedrawCtrl")

$s = 0
Dim $SelSprite[11]
$posx = ""
$posy = ""

$e = 0

$backpic = LoadExtImage($pic[$e])
$ctrldc = CtrlGetDC($PROSPEED) ; get controlDC for sprites and pictures
CopyExtBmp($ctrldc, 0, 0, 250, 250, $backpic, 0, 0, 0) ; copy picture to pic control

CreateBuffer(250,250) ; create screenbuffer for wm_paint and sprites
$buffer = SetBuffer($backpic) ; copy $backpic into screenbuffer

_NextPic() ; Change to first Background

Func RedrawCtrl() ; function to redraw only the picture on the pic conrtol, activated by custom wm_paint
    Sleep(20) ; some wait , let tab control refresh first , then redraw picture
    CopyExtBmp($ctrldc, 0, 0, 250, 250, $buffer, 0, 0, 0) ; copy buffer to control
EndFunc

; Main Loop
while 1
    ; Sub Sprite Move Loop
    for $z = 0 to 20
        $s += 1
        if $s > 9 then $s = Random (0,10,1)
        if $backpic then
            Global $posx = Random(50,200,1)
            Global $posy = Random(50,200,1)
            if not $SelSprite[$s] then ; Sprite Init
                ConsoleWrite("Creating Sprite" & @CRLF)
                $SelSprite[$s] = sprite($Bee[0], $ctrldc, 0, 0, 24, 18, 4, 1, 6, $posx,$posy)
                SetSpriteSpeed ($SelSprite[$s], 1, 1)
                SetSpriteMovingMode($SelSprite[$s], 1)
            else ; Sprite set continous coords
            Endif
            ConsoleWrite("Move to "&$posx&","&$posy& @CRLF)
            Movesprite($SelSprite[$s], $posx, $posy)
        Endif
    
        sleep(100) ; this equals code with some calculations
        ;###### Code #####
    next

    ;###### Code #####
    sleep(2000) ; this equals code with lots of calculations
wend

func _NextPic()
    $backpic = LoadExtImage($pic[$e]) ; load next Background into memory
    
    $w = GetBmpWidth($backpic) ; get width of picture, because the downloaded  pictures have diferent sizes
    $h = GetBmpHeight($backpic) ; get height of picture
    $tmp = CreateExtBmp(250,250) ; create empty bitmap 
    Size($tmp, 0, 0, 250, 250, $backpic, 0, 0, $w, $h, 0) ; resize picture to fit to control 250x250
    FreeExtBmp($backpic) ; free backpic , we need a new one
    $backpic = CreateExtBmp(250, 250) ; create empty bitmap
    CopyExtBmp($backpic, 0, 0, 250, 250, $tmp, 0, 0, 0) ; copy tmp bitmap with resized picture to empty bitmap
    FreeExtBmp($tmp) ; free tmp bitmap, not needed anymore
    CopyExtBmp($ctrldc, 0, 0, 250, 250, $backpic, 0, 0, 0) ; copy new backpic with resized picture to pic control
    $buffer = SetBuffer($backpic) ; setbuffer , copy new backpic to screenbuffer for wm_paint and sprites
    
    $e += 1
    if $e > 2 then $e = 0
EndFunc

Func _ShowCircles()
    If GUICtrlRead($Button4) = $Gui_CHECKED then
        ConsoleWrite("Show Circles" & @CRLF)
        $rnd_color = "0x"&hex(Random(0,255,1),2)&hex(Random(0,255,1),2)&hex(Random(0,255,1),2)
        
        $tmp = CreateExtBmp(250,250) ; create empty bitmap for circle draw
        CopyExtBmp($tmp, 0, 0, 250, 250, $backpic, 0, 0, 0) ; copy backpic into empty bitmap
        _GDI_Arc ($tmp, Random(50,200,1), Random(50,200,1), Random(10,50,1), Random(1,10,1), $rnd_color) ; draw circle to tmp bitmap
        CopyExtBmp($ctrldc, 0, 0, 250, 250, $tmp, 0, 0, 0) ; copy tmp bitmap with contains the backpic and new circle to tab control
        $buffer = SetBuffer($tmp) ; setbuffer , copy tmp bitmap to screenbuffer for wm_paint and sprites
        FreeExtBmp($tmp) ; free tmp bitmap, not needed anymore
    else        
        ConsoleWrite("Hide Circles" & @CRLF)
        CopyExtBmp($ctrldc, 0, 0, 250, 250, $backpic, 0, 0, 0) ; copy orginale backpic to tab control
        $buffer = SetBuffer($backpic) ; setbuffer , copy orginale backpic to screenbuffer for wm_paint and sprites
    endif
EndFunc

func _GDI_Arc ($tmp_hdc, $X, $Y, $Rad, $Width, $Color); $X= Midpoint X coord, $Y= Midpoint Y coord, $Rad= Radius
    local $Xleft = $X - $rad, $Ytop = $Y - $rad, $Xright = $X + $rad, $Ybottom = $Y + $rad
    local $Xstart = 0 , $YStart = 0, $XEnd = 0, $YEnd = 0
    local $S_pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0, "int", $width, "int", $Color)
    DllCall("gdi32.dll", "int", "SelectObject", "int", $tmp_hdc, "int", $S_pen[0])
    DLLCall($gdidll ,"int","Arc", _
                        "hwnd", $tmp_hdc, _
                        "int" , $Xleft, _
                        "int" , $Ytop, _
                        "int" , $Xright, _
                        "int" , $Ybottom, _
                        "int" , $Xstart, _
                        "int" , $YStart, _
                        "int" , $XEnd, _
                        "int" , $YEnd)
    DllCall("gdi32.dll", "int", "DeleteObject", "hwnd", $S_pen)
endfunc

; Altered loadsprite UDF
Func _loadsprite($S_SPRITE_PIC, $getarr = 0)
    $S_Spriteplane = DllCall($S_DLL, "long", "LoadExtImage", "str", $S_SPRITE_PIC)
    
    if not $getarr = 0 then 
        $S_WIDT  = DllCall($S_DLL, "long", "GetBmpWidth", "long", $S_Spriteplane[0])
        $S_HEIGH = DllCall($S_DLL, "long", "GetBmpHeight", "long", $S_Spriteplane[0])
        $S_W = $S_WIDT[0]
        $S_H = $S_HEIGH[0]
;~   MsgBox(0,0,$S_W&", "&$S_H)
        Dim $arr[3] = [$S_Spriteplane[0], $S_W, $S_H]
        Return $arr
    Else
        Return $S_Spriteplane[0]
    EndIf
Endfunc

Func _exit()
    FreeAllExtBmps()
    DeleteAllSprites() ; delete all sprites, otherwise you get errors when program exit
    DestroyBuffer() ; free screenbuffers
    DllClose($gdidll)
    Exit
EndFunc
Link to comment
Share on other sites

Trying to run the RotateFx (Clock) part of the demo on its own, but I get (several) errors A Vector [] Out of Bounds..

The pictures required for the clock are in the same folder as the program.

#include <GUIConstants.au3>
#include <Prospeed.au3>
#include <FMod.au3>
#include <Sound.au3>
#include <Math.au3>

;WinMinimizeAll()

Opt("GUIOnEventMode", 1)
HotKeySet("{Esc}","_Exit")
ProcessSetPriority ( "Prospeed Demonstration", 4)

GUICreate("Prospeed Demonstration", 800, 600)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUISetState()

Dim $sprite[12]
Dim $D_bitmap[12]
Dim $B_bitmap[12]
Dim $fxi[12]


GetHDC()
CreateBuffer(800, 600)

FxRotate()

Func FXRotate()
    WinSetTitle("", "", "FX Rotate:         Rotate picture")

    $clock = LoadExtImage("clock.png")
    $bitmap0 = CreateExtBmp(800, 600)
    CopyExtBmp($hDC, 0, 0, 800, 600, $bitmap0, 0, 0, 0)

    $big = LoadExtImage("big.png")
    $bitmap1 = CreateExtBmp(400, 400)
    CopyExtBmp($bitmap1, 170, -20, 400, 400, $big, 0, 0, 0)

    $small = LoadExtImage("small.png")
    $bitmap3 = CreateExtBmp(400, 400)
    CopyExtBmp($bitmap3, 180, 65, 400, 400, $small, 0, 0, 0)

    $fx1 = InitExtFX($bitmap1)
    $fx2 = InitExtFX($clock)
    $fx3 = InitExtFX($bitmap3)

    $bitmap4 = CreateExtBmp(400, 400)

    $i2 = 360
    $i1 = 360

    For $u = 1 To 181
        Rotate($bitmap4, 0, 0, $fx2, $fx3, $i2, -1)
        $fx2 = InitExtFX($bitmap4)
        Rotate($hDC, 200, 100, $fx2, $fx1, $i1, -1) 
        CopyExtBmp($bitmap4, 0, 0, 400, 400, $clock, 0, 0, 0)
        $fx2 = InitExtFX($clock)
        Sleep(10)   
        If $i1 < 1 Then 
            $i1 = 360
        EndIf
        If $i2 < 1 Then $i2 = 360
        $i1 -=12
        $i2 -=1
    next
    
    FreeExtFX($fx1)
    FreeExtFX($fx2)
    FreeExtFX($fx3)
    FreeExtBmp($bitmap1)
    FreeExtBmp($bitmap3)
    FreeExtBmp($bitmap4)
    FreeExtBmp($small)
    FreeExtBmp($big)
    FreeExtBmp($clock)
EndFunc

Func _exit()
    Exit
EndFunc

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

If there a function to create a transparent window, so that effects would appear part of the DeskTop?

I`ve been playing with the GDIplus functions (see http://www.autoitscript.com/forum/index.ph...p;#entry516232) to create transparent windows but they are less than easy to use...

The idea here is to create a "windowless" clock on the desktop.

Thanks. :)

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

use $hdc = GetDesktopHDC ()

then copy to the desktop with CopyExtBmp () with $hdc as Destination.

That writes to the desktop, I`m looking at a borderless window with no minimize, close etc, something like this..

$Parent  = GUICreate("Rectangle", $WinWd, $WinHgt, 200,  200, 0, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
$hPic = GUICreate("Test", $WinWd, $WinHgt, -1, -1, -1, BitOr($WS_EX_LAYERED, $WS_EX_MDICHILD), $Parent )
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Images\Image.png")
SetBitMap($hPic, $hImage, 255) 
GUISetState()oÝ÷ Ù»­ºÈ§Ø^¦º,¥ç~éܶ*'²)ìµæ¡ûax`È>[¬~éܶ*'°a¢è!¶ØZ¶­¶)ඩ®)]X§¶²Z)Ý£?K+7Ùú%uêð¢é]ÂänëbµÚ³Þ§´zË«zØZ¶Ì!z·¢·¬mçè­å¡W zÛbazȳyצ¢Ú0¢¹(+{ayø«²ÚZ®Ú±Êâ¦×bwÞ§µÚ+ax!z·¬¶®¥Ö­y«­¢+Ø¥¹±Õ±ÐíU%
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±ÐíAɽÍÁ¹ÔÌÐì(¥¹±Õ±Ðí5½¹ÔÌÐì(¥¹±Õ±ÐíM½Õ¹¹ÔÌÐì(¥¹±Õ±Ðí5Ñ ¹ÔÌÐì((í]¥¹5¥¹¥µ¥é±° ¤()=ÁÐ ÅÕ½ÐíU%=¹Ù¹Ñ5½ÅÕ½Ðì°Ä¤)!½Ñ-åMÐ ÅÕ½ÐííÍôÅÕ½Ðì°ÅÕ½Ðí}á¥ÐÅÕ½Ðì¤)AɽÍÍMÑAÉ¥½É¥Ñä ÅÕ½ÐíAɽÍÁµ½¹ÍÑÉÑ¥½¸ÅÕ½Ðì°Ð¤()U%
ÉÑ ÅÕ½ÐíAɽÍÁµ½¹ÍÑÉÑ¥½¸ÅÕ½Ðì°àÀÀ°ØÀÀ¤)U%MÑ=¹Ù¹Ð ÀÌØíU%}Y9Q}
1=M°ÅÕ½Ðí}á¥ÐÅÕ½Ðì¤)U%MÑMÑÑ ¤()¥´ÀÌØíÍÁÉ¥ÑlÄÉt)¥´ÀÌØí}¥ÑµÁlÄÉt)¥´ÀÌØí }¥ÑµÁlÄÉt)¥´ÀÌØíá¥lÄÉt)±½°ÀÌØíÁ¥ô1½áÑ%µ ÅÕ½Ðí%µÌÀäÈíÕѽ¥Ñ}Õ¥±É}ݱ±|àÀÁàØÀÀ¹©ÁÅÕ½Ðì¤()Ñ! ¤$$$$ì%ÐÌäíÌÑ¡!½ÈÑ¡Ñ¥ÙÝ¥¹½Ü)
ÉÑ    ÕÈ ÐÀÀ°ÐÀÀ¤$ì%
ÉÑÌÍɸÕȽÈ]5}A¥¹ÐѼÉÉÜÑ¡Íɸ()áM¥é ¤()Õ¹aM¥é ¤(]¥¹MÑQ¥Ñ± ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðí`M¥éèIÍ¥éÁ¥ÑÕÉÅÕ½Ðì¤($ÀÌØí¬Äô1½áÑ%µ ÅÕ½ÐíÕѽ¥Ñ}Õ¥±É}ݱ±|àÀÁàØÀÀ¹©ÁÅÕ½Ðì¤($ÀÌØí¬Èô1½áÑ%µ ÅÕ½ÐíÕѽ¥Ñ}Õ¥±É}ݱ±}ÁÉÁɹ©ÁÅÕ½Ðì¤($($$ÀÌØí¥ÑµÀô
ÉÑáÑ    µÀ àÀÀ°ØÀÀ¤($$(%½ÈÀÌØí¤ôÄQ¼àÀÀMÑÀÄÀ($$ÀÌØí¥ÑµÀô
ÉÑáÑ    µÀ àÀÀ°ØÀÀ¤($%M¥é ÀÌØí¥ÑµÀ°ÀÌØí¤¼È°À°àÀÀ´ÀÌØí¤°ØÀÀ°ÀÌØí¬Ä°À°À°àÀÀ°ØÀÀ°À¤$$($%
½ÁåáÑ  µÀ ÀÌØí¡°À°À°àÀÀ°ØÀÀ°ÀÌØí¥ÑµÀ°À°À°À¤($%ÉáÑ    µÀ ÀÌØí¥ÑµÀ¤($%M±À Ĥ(%9áÐ(íM±À ÄÀÀÀ¤$($ÀÌØíÉÉäÄô%¹¥ÑáÑ` ÀÌØí¬È¤($ÀÌØí¬É}±¥Áàô
ÉÑáÑ    µÀ àÀÀ°ØÀÀ¤(%±¥Á` ÀÌØí¬É}±¥Áà°À°À°ÀÌØíÉÉäĤ(($ÀÌØíÉÉäÈô%¹¥ÑáÑ` ÀÌØí¬È¤($ÀÌØí¬É}±¥Áäô
ÉÑáÑ    µÀ àÀÀ°ØÀÀ¤(%±¥Ád ÀÌØí¬É}±¥Áä°À°À°ÀÌØíÉÉäȤ(($ÀÌØí¥ÑµÀô
ÉÑáÑ    µÀ àÀÀ°ØÀÀ¤((%½ÈÀÌØí¤ôÄQ¼àÀÀMÑÀÄÀ($$ÀÌØí¥ÑµÀô
ÉÑáÑ    µÀ àÀÀ°ØÀÀ¤($%M¥é ÀÌØí¥ÑµÀ°ÐÀÀ´ÀÌØí¤¼È°À°ÀÌØí¤°ØÀÀ°ÀÌØí¬É}±¥Áà°À°À°àÀÀ°ØÀÀ°À¤($%
½ÁåáÑ  µÀ ÀÌØí¡°À°À°àÀÀ°ØÀÀ°ÀÌØí¥ÑµÀ°À°À°À¤($%ÉáÑ    µÀ ÀÌØí¥ÑµÀ¤($%M±À Ĥ(%9áÐ($(%½ÈÀÌØí¤ôÄQ¼àÀÀMÑÀÄÀ($$ÀÌØí¥ÑµÀô
ÉÑáÑ    µÀ àÀÀ°ØÀÀ¤($%M¥é ÀÌØí¥ÑµÀ°ÀÌØí¤¼È°À°àÀÀ´ÀÌØí¤°ØÀÀ°ÀÌØí¬É}±¥Áà°À°À°àÀÀ°ØÀÀ°À¤($%
½ÁåáÑ  µÀ ÀÌØí¡°À°À°àÀÀ°ØÀÀ°ÀÌØí¥ÑµÀ°À°À°À¤($%ÉáÑ    µÀ ÀÌØí¥ÑµÀ¤($%M±À Ĥ(%9áÐ($(%½ÈÀÌØí¤ôÄQ¼àÀÀMÑÀÄÀ($$ÀÌØí¥ÑµÀô
ÉÑáÑ    µÀ àÀÀ°ØÀÀ¤($%M¥é ÀÌØí¥ÑµÀ°ÐÀÀ´ÀÌØí¤¼È°À°ÀÌØí¤°ØÀÀ°ÀÌØí¬Ä°À°À°àÀÀ°ØÀÀ°À¤($%
½ÁåáÑ  µÀ ÀÌØí¡°À°À°àÀÀ°ØÀÀ°ÀÌØí¥ÑµÀ°À°À°À¤($%ÉáÑ    µÀ ÀÌØí¥ÑµÀ¤($%M±À Ĥ(%9áÐ($(%½ÈÀÌØí¤ôÄQ¼ØÀÀMÑÀÄÀ($$ÀÌØí¥ÑµÀô
ÉÑáÑ    µÀ àÀÀ°ØÀÀ¤($%M¥é ÀÌØí¥ÑµÀ°À°ÀÌØí¤¼È°àÀÀ°ØÀÀ´ÀÌØí¤°ÀÌØí¬Ä°À°À°àÀÀ°ØÀÀ°À¤($%
½ÁåáÑ  µÀ ÀÌØí¡°À°À°àÀÀ°ØÀÀ°ÀÌØí¥ÑµÀ°À°À°À¤($%ÉáÑ    µÀ ÀÌØí¥ÑµÀ¤($%M±À Ĥ(%9áÐ((%½ÈÀÌØí¤ôÄQ¼ØÀÀMÑÀÄÀ($$ÀÌØí¥ÑµÀô
ÉÑáÑ    µÀ àÀÀ°ØÀÀ¤($%M¥é ÀÌØí¥ÑµÀ°À°ÌÀÀ´ÀÌØí¤¼È°àÀÀ°ÀÌØí¤°ÀÌØí¬É}±¥Áä°À°À°àÀÀ°ØÀÀ°À¤($%
½ÁåáÑ  µÀ ÀÌØí¡°À°À°àÀÀ°ØÀÀ°ÀÌØí¥ÑµÀ°À°À°À¤($%ÉáÑ    µÀ ÀÌØí¥ÑµÀ¤($%M±À Ĥ(%9áÐ((%½ÈÀÌØí¤ôÄQ¼ØÀÀMÑÀÄÀ($$ÀÌØí¥ÑµÀô
ÉÑáÑ    µÀ àÀÀ°ØÀÀ¤($%M¥é ÀÌØí¥ÑµÀ°À°ÀÌØí¤¼È°àÀÀ°ØÀÀ´ÀÌØí¤°ÀÌØí¬É}±¥Áä°À°À°àÀÀ°ØÀÀ°À¤($%
½ÁåáÑ  µÀ ÀÌØí¡°À°À°àÀÀ°ØÀÀ°ÀÌØí¥ÑµÀ°À°À°À¤($%ÉáÑ    µÀ ÀÌØí¥ÑµÀ¤($%M±À Ĥ(%9áÐ((%½ÈÀÌØí¤ôÄQ¼ØÀÀMÑÀÄÀ($$ÀÌØí¥ÑµÀô
ÉÑáÑ    µÀ àÀÀ°ØÀÀ¤($%M¥é ÀÌØí¥ÑµÀ°À°ÌÀÀ´ÀÌØí¤¼È°àÀÀ°ÀÌØí¤°ÀÌØí¬Ä°À°À°àÀÀ°ØÀÀ°À¤($%
½ÁåáÑ  µÀ ÀÌØí¡°À°À°àÀÀ°ØÀÀ°ÀÌØí¥ÑµÀ°À°À°À¤($%ÉáÑ    µÀ ÀÌØí¥ÑµÀ¤($%M±À Ĥ(%9áÐ($(%ÉáÑ   µÀ ÀÌØí¬Ä¤(%ÉáÑ µÀ ÀÌØí¬È¤(%ÉáÑ µÀ ÀÌØí¬É}±¥Áä¤(%ÉáÑ    µÀ ÀÌØí¬É}±¥Áà¤(%ÉáÑ    µÀ ÀÌØí¥ÑµÀ¤(%ÉáÑ` ÀÌØíÉÉäĤ(%ÉáÑ` ÀÌØíÉÉäȤ)¹Õ¹()Õ¹}á¥Ð ¤(%á¥Ð)¹Õ¹

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

something like this ?

$WS_EX_LAYERED        = 0x00080000
$GUI_WS_EX_PARENTDRAG = 0x00100000
$WS_POPUP             = 0x80000000

#include <prospeed.au3>

$gui = GUICreate("trans", 500, 400, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
GUICtrlCreateLabel("Click label to drag window", 50, 0, 200, 25, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetFont(-1,14,900)
GUISetBkColor(0xABCDEF)
DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $gui, "long", 0xEFCDAB , "byte", 255, "long", 0x1 + 0x2)
GUISetState()

$hdc = GetHDC()
CreateBuffer(300,400)
SetBuffer($hdc)

$spritepic = LoadExtImage("bird.png")
$sprite = Sprite($spritepic, $hdc, 0, 0, 47, 42, 4, 1, 6, 100, 100)

While 1
    $extMsg = GUIGetMsg()
    $msg = $extMsg
    Select
        Case $msg = -3
            deleteallsprites()
            FreeAllExtBmps()
            Exit    
    EndSelect
WEnd

post-5777-1210021839_thumb.png

Link to comment
Share on other sites

something like this ?

$WS_EX_LAYERED        = 0x00080000
$GUI_WS_EX_PARENTDRAG = 0x00100000
$WS_POPUP             = 0x80000000

#include <prospeed.au3>

$gui = GUICreate("trans", 500, 400, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
GUICtrlCreateLabel("Click label to drag window", 50, 0, 200, 25, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetFont(-1,14,900)
GUISetBkColor(0xABCDEF)
DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $gui, "long", 0xEFCDAB , "byte", 255, "long", 0x1 + 0x2)
GUISetState()

$hdc = GetHDC()
CreateBuffer(300,400)
SetBuffer($hdc)

$spritepic = LoadExtImage("bird.png")
$sprite = Sprite($spritepic,  0, 0, 47, 42, 4, 1, 6, 100, 100)

While 1
    $extMsg = GUIGetMsg()
    $msg = $extMsg
    Select
        Case $msg = -3
            deleteallsprites()
            FreeAllExtBmps()
            Exit    
    EndSelect
WEndoÝ÷ Ù«miÈfz{

This puts the clock into center of the GUI, what do I change to fit the clock into an 400 x 400 GUI window.

I guess I need a simple example of how to put a picture into the GUI window....

CreateBuffer is used by Wm_paint to redraw the screen, so if its a static picture is this still needed?

Thanks as always! :)

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

$hdc = GetHDC()
$clock = LoadExtImage("clock.png")
CreateBuffer(400,400)
CopyExtBmp($hdc,0,0,400,400,$clock,0,0,0)
; or if your picture is bigger then 400x400 then
; Size($hdc,0,0,400,400,$clock,0,0,500,500,0)
SetBuffer($clock)

Link to comment
Share on other sites

Thanks, I understand better how the Rotate Script works now.

Have added some comments...

#include <GUIConstants.au3>
#include <Prospeed.au3>
#include <FMod.au3>
#include <Sound.au3>
#include <Math.au3>

;WinMinimizeAll()

Opt("GUIOnEventMode", 1)
HotKeySet("{Esc}","_Exit")
ProcessSetPriority ( "Prospeed Demonstration", 4)

GUICreate("Prospeed Demonstration", 400, 400)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUISetState()


GetHDC()
CreateBuffer(400, 400)

FxRotate()

Func FXRotate()
    WinSetTitle("", "", "FX Rotate:         Rotate picture")

    $clock = LoadExtImage("clock.png")
    $MinutesHnd = LoadExtImage("big.png")
    
    $minshand = CreateExtBmp(400, 400)  
;   syntax : $bitmap1 = CreateExtBmp(400, 300)  
;   Note   ; creates a empty bitmap in memory
;            $C_Width  = width of the bitmap
;            $C_Height = height of the bitmap
;   returns pointer for imagedata

    CopyExtBmp($minshand, 170, -20, 400, 400, $MinutesHnd, 0, 0, 0)
;   syntax : CopyExtBmp($bitmap1, 0, 0, 400, 300, $hDC, 200, 150)   
;   Note   ; copie a bitmap to HDC (window) or another bitmap created with CreateExtBmp
;            $C_Destination = Destination to copie the bitmap to
;            $C_OffsetX     = offset on x axis to begin the copie on the destination bitmap
;            $Cs_Width      = width of the bitmap to be copied
;            $Cs_Height     = height of the bitmap to be copied
;            $C_Source      = source bitmap
;            $C_PosX        = x offset of the source bitmap to begin to copie
;            $C_PosY        = y offset of the source bitmap to begin to copie


    $HoursHand = LoadExtImage("small.png")
    $HrsHnd = CreateExtBmp(400, 400)
    CopyExtBmp($HrsHnd, 180, 65, 400, 400, $HoursHand, 0, 0, 0)

;   syntax : $FX = InitExtFX($bitmap1)  
;   Note ; creates a byte array from a bitmap for Special fx functions
;   returns pointer for fx effect
    $fxmins = InitExtFX($minshand)
    $fxClk = InitExtFX($clock)
    $fxHrsHand = InitExtFX($HrsHnd)

    $Clk = CreateExtBmp(400, 400)

    $i2 = 360
    $i1 = 360
    
;   syntax : IniRotate()
;   Note ;  Need to be loaded before Function Rotate($S_Alias, $S_POSX, $S_POSY, $S_DEGREE)
;           No parameters required
;     ***********  IniRotate() causes error, been replaced by InitFX? **********************

;   Effect Rotate 
;   syntax :         Rotate(Alias, POS X, POS Y, DEGREE)
;   is really...       Rotate(Alias, POS X, POS Y, Source1, Source2, DEGREE, Mode)

;   Note ;  Alias = String created by Function LoadImage() 
;           POS X and POS Y are the position's where the picture is copy to the window
;           DEGREE 0 to 360
    For $u = 1 To 360
        Rotate($Clk, 0, 0, $fxClk, $fxHrsHand, $i2, -1)
        $fxClk = InitExtFX($Clk)
        Rotate($hDC, 0, 0, $fxClk, $fxmins, $i1, -1)    
        CopyExtBmp($Clk, 0, 0, 400, 400, $clock, 0, 0, 0)
        $fxClk = InitExtFX($clock)
        Sleep(10)   
        If $i1 < 1 Then 
            $i1 = 360
        EndIf
        If $i2 < 1 Then $i2 = 360
        $i1 -=12
        $i2 -=1
    next

Sleep(5000)
    FreeExtFX($fxmins)
    FreeExtFX($fxClk)
    FreeExtFX($fxHrsHand)
    FreeExtBmp($minshand)
    FreeExtBmp($HrsHnd)
    FreeExtBmp($Clk)
    FreeExtBmp($HoursHand)
    FreeExtBmp($MinutesHnd)
    FreeExtBmp($clock)
EndFunc

Func _exit()
    Exit
EndFunc
What does the Mode part of "Rotate(Alias, POS X, POS Y, Source1, Source2, DEGREE, Mode)" do?

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

:)

free your fx ,otherwise you have a huge memory leak in the loop

For $u = 1 To 360
        Rotate($Clk, 0, 0, $fxClk, $fxHrsHand, $i2, -1)
        $fxClk = InitExtFX($Clk)
        Rotate($hDC, 0, 0, $fxClk, $fxmins, $i1, -1)    
        CopyExtBmp($Clk, 0, 0, 400, 400, $clock, 0, 0, 0)
        FreeExtFX($fxClk) ; free your fx ,otherwise you have a huge memory leak in the loop
        $fxClk = InitExtFX($clock)
        Sleep(10)   
        If $i1 < 1 Then 
            $i1 = 360
        EndIf
        If $i2 < 1 Then $i2 = 360
        $i1 -=12
        $i2 -=1
    next

the mode parameter is the copymode -1 or 0

-1 is tranparent copy

0 is normal copy

Link to comment
Share on other sites

:)

free your fx ,otherwise you have a huge memory leak in the loop

For $u = 1 To 360
        Rotate($Clk, 0, 0, $fxClk, $fxHrsHand, $i2, -1)
        $fxClk = InitExtFX($Clk)
        Rotate($hDC, 0, 0, $fxClk, $fxmins, $i1, -1)    
        CopyExtBmp($Clk, 0, 0, 400, 400, $clock, 0, 0, 0)
        FreeExtFX($fxClk) ; free your fx ,otherwise you have a huge memory leak in the loop
        $fxClk = InitExtFX($clock)
        Sleep(10)   
        If $i1 < 1 Then 
            $i1 = 360
        EndIf
        If $i2 < 1 Then $i2 = 360
        $i1 -=12
        $i2 -=1
    nextoÝ÷ ÚØ^^¥ªÚë^®+-ç(§)¨uíh¯Mb²ÚÚ«z{¢´Éè®f¥rrþ«¨µæ®¶­sb6æ6ÇVFRfÇC´uT6öç7FçG2æS2fwC°¢6æ6ÇVFRfÇCµ&÷7VVBæS2fwC°¢6æ6ÇVFRfÇC´dÖöBæS2fwC°¢6æ6ÇVFRfÇCµ6÷VæBæS2fwC°¢6æ6ÇVFRfÇC´ÖFæS2fwC° £µväÖæÖ¦TÆ ¤÷BgV÷C´uTöäWfVçDÖöFRgV÷C²Â¤÷D¶W6WBgV÷C·´W67ÒgV÷C²ÂgV÷CµôWBgV÷C²¥&ö6W756WE&÷&GgV÷Cµ&÷7VVBFVÖöç7G&FöâgV÷C²ÂB ¤uT7&VFRgV÷Cµ&÷7VVBFVÖöç7G&FöâgV÷C²ÂCÂC¤uT6WDöäWfVçBb33c´uTôUdTåEô4Äõ4RÂgV÷CµöWBgV÷C²¤uT6WE7FFR  ¤vWDD2£´7&VFT'VffW"CÂC ¤g&÷FFR ¤gVæ2e&÷FFR¢vå6WEFFÆRgV÷C²gV÷C²ÂgV÷C²gV÷C²ÂgV÷C´e&÷FFS¢&÷FFR7GW&RgV÷C²  b33c¶6Æö6²ÒÆöDWDÖvRgV÷C¶6Æö6²çærgV÷C² b33c´ÖçWFW4æBÒÆöDWDÖvRgV÷C¶&rçærgV÷C²  b33c¶Öç6æBÒ7&VFTWD&×CÂC²¢¢¢¢¢¢¢¢¢¢¢v6âb3c·B6ævRF2FòFRÖvR6¦Sð£°7çF¢b33c¶&FÖÒ7&VFTWD&×CÂ3£°æ÷FR²7&VFW2V×G&FÖâÖVÖ÷'£°b33c´5õvGFÒvGFöbFR&FÖ£°b33c´5ôVvBÒVvBöbFR&FÖ£°&WGW&ç2öçFW"f÷"ÖvVFF  ´6÷WD&×b33c¶Öç6æBÂsÂÓ#ÂCÂCÂb33c´ÖçWFW4æB¶Öç4æBÒb33c´&rSb# 6÷WD&×b33c¶Öç6æBÂÂÂSbÂ#Âb33c´ÖçWFW4æB¶Öç4æBÒb33c´&rSb#£°7çF¢6÷WD&×b33c¶&FÖÂÂÂCÂ3Âb33c¶D2Â#ÂS£°æ÷FR²6÷R&FÖFòD2væF÷r÷"æ÷FW"&7&VFVBvF7&VFTWD&×£°b33c´5ôFW7FæFöâÒFW7FæFöâFò6÷RFR&FÖFð£°b33c´5ôöfg6WEÒöfg6WBöâ2Fò&VvâFR6÷RöâFRFW7FæFöâ&FÖ£°b33c´75õvGFÒvGFöbFR&FÖFò&R6÷V@£°b33c´75ôVvBÒVvBöbFR&FÖFò&R6÷V@£°b33c´5õ6÷W&6RÒ6÷W&6R&FÖ£°b33c´5õ÷5Òöfg6WBöbFR6÷W&6R&FÖFò&VvâFò6÷P£°b33c´5õ÷5Òöfg6WBöbFR6÷W&6R&FÖFò&VvâFò6÷P   b33c´÷W'4æBÒÆöDWDÖvRgV÷C·6ÖÆÂçærgV÷C² b33c´'4æBÒ7&VFTWD&×CÂC 6÷WD&×b33c´'4æBÂÂcRÂC"ÂrÂb33c´÷W'4æB´÷W'6æBÒb33cµ6ÖÆÂC'p £°7çF¢b33c´eÒæDWDeb33c¶&FÖ£°æ÷FR²7&VFW2'FR'&g&öÒ&FÖf÷"7V6ÂggVæ7Föç0£°&WGW&ç2öçFW""gVffV7@ b33c¶gÖç2ÒæDWDeb33c¶Öç6æB b33c¶g6ƲÒæDWDeb33c¶6Æö6² b33c¶g'4æBÒæDWDeb33c´'4æB  b33c´6ƲÒ7&VFTWD&×CÂC  b33c¶"Ò3c b33c¶Ò3c £°7çF¢æ&÷FFR£°æ÷FR²æVVBFò&RÆöFVB&Vf÷&RgVæ7Föâ&÷FFRb33cµ5ôÆ2Âb33cµ5õõ5Âb33cµ5õõ5Âb33cµ5ôDTu$TR£°æò&ÖWFW'2&WV&V@£°æ&÷FFR7V6W2W'&÷"Â&VVÒ&WÆ6VB'æDeð £°VffV7B&÷FFR£°7çF¢&÷FFRÆ2Âõ2Âõ2ÂDTu$TR£²2&VÆÇâââ&÷FFRÆ2Âõ2Âõ2Â6÷W&6SÂ6÷W&6S"ÂDTu$TRÂÖöFR £°æ÷FR²Æ2Ò7G&ær7&VFVB'gVæ7FöâÆöDÖvR£°õ2æBõ2&RFR÷6Föâb33·2vW&RFR7GW&R26÷FòFRvæF÷p£°DTu$TRFò3c f÷"b33c·RÒFò3c b33c¶g6ƲÒæDWDeb33c¶6Æö6² &÷FFRb33c´6ƲÂÂÂb33c¶g6ƲÂb33c¶g'4æBÂb33c¶"ÂÓ b33c¶g6ƲÒæDWDeb33c´6Ʋ &÷FFRb33c¶D2ÂÂÂb33c¶g6ƲÂb33c¶gÖç2Âb33c¶ÂÓ 6÷WD&×b33c´6ƲÂÂÂCÂCÂb33c¶6Æö6²Â g&VTWDeb33c¶g6Ʋ 6ÆVW bb33c¶fÇC²FVâ b33c¶Ò3c VæD` bb33c¶"fÇC²FVâb33c¶"Ò3c b33c¶ÓÓ  b33c¶"ÓÓ æW@ ¥6ÆVWS g&VTWDeb33c¶gÖç2 g&VTWDeb33c¶g6Ʋ g&VTWDeb33c¶g'4æB g&VTWD&×b33c¶Öç6æB g&VTWD&×b33c´'4æB g&VTWD&×b33c´6Ʋ g&VTWD&×b33c´÷W'4æB g&VTWD&×b33c´ÖçWFW4æB g&VTWD&×b33c¶6Æö6²¤VæDgVæ0 ¤gVæ2öWB W@¤VæDgVæ0
$minshand = CreateExtBmp(400, 400) ; *********** Why can`t I change this to the image size?

If I try to change the above to anything under 400, the program quits.

The idea here is that its better to rotate a small bitmap rather than a 400 x 400 one.

And the other line I`ve changed is CopyExtBmp($minshand, 0, 0, 56, 200, $MinutesHnd, 0, 0, 0) ;minsHand = $Big 56 x 200

Kinda funny.. :(

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

haha, sure its funny :)

array datas must be of the same size for the Rotate function !

So even though the pointer is smaller than the Clock Face, the the array for the pointer graphic still has to be the same size as the clock face graphic?

So, Rotate($hDC, 0, 0, $fxClk, $fxmins, $i1, -1) where $hDC is a pointer to the window, $FxClock is a pointer to the Byte array for the Clock Face and $fxmins is a pointer to the array created for the minuites hand, and all arrays must be be of same size regardless of image size? Correct?

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

don't mix the pointers and the arrays

a pointer is a point to a memory location where the array data start

a bitmap array is a block of image data ,they must be the same size for the rotate function

that's why you have to copy the mins and the hour graphic to a new bitmap the same size as the clockface,

before you make them array's

So, Rotate($hDC, 0, 0, $fxClk, $fxmins, $i1, -1) where $hDC is a pointer to the window, $FxClock is a pointer to the Byte array for the Clock Face and $fxmins is a pointer to the array created for the minuites hand, and all arrays must be be of same size regardless of image size? Correct?

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...