kiennv159 Posted March 21, 2011 Share Posted March 21, 2011 I desperately needed a heart (excluding a picture ) it can be draw with _GDI or something useful Who can give me a function for handling this? Link to comment Share on other sites More sharing options...
Andreik Posted March 21, 2011 Share Posted March 21, 2011 You didn't tell us most important thing: where you want to draw this heart? When the words fail... music speaks. Link to comment Share on other sites More sharing options...
saywell Posted March 21, 2011 Share Posted March 21, 2011 If you look in the help file at GUICtrlSetGraphic you'll see in the example a drawing that's heart-shaped one side [but not the other]. you should be able to make that symmetrical to produce your heart drawing. William Link to comment Share on other sites More sharing options...
Andreik Posted March 21, 2011 Share Posted March 21, 2011 (edited) I have this script on my computer for long time ago, someone from this forum wrote this code some time ago [i don't know who but all credits go for him], maybe helps you: expandcollapse popupAutoItSetOption("PixelCoordMode",1) Global $COLOR = 0x000000FF ; RED HotKeySet("{ESC}","Quit") ;Press ESC to Quit While True $POS = MouseGetPos() DrawHeart($POS[0],$POS[1]) Sleep(200) WEnd Func Quit() Exit EndFunc Func DrawPixel($DC,$X,$Y,$COLOR) DllCall ("gdi32.dll","long","SetPixel","long",$DC,"long",$X,"long",$Y,"long",$COLOR) EndFunc Func DrawHeart($X,$Y) $DC = DllCall ("user32.dll", "int", "GetDC", "hwnd", "") DrawPixel($DC[0],$X+0,$Y+5,$COLOR) DrawPixel($DC[0],$X+0,$Y+6,$COLOR) DrawPixel($DC[0],$X+0,$Y+7,$COLOR) DrawPixel($DC[0],$X+0,$Y+8,$COLOR) DrawPixel($DC[0],$X+0,$Y+9,$COLOR) DrawPixel($DC[0],$X+0,$Y+10,$COLOR) DrawPixel($DC[0],$X+1,$Y+3,$COLOR) DrawPixel($DC[0],$X+1,$Y+4,$COLOR) DrawPixel($DC[0],$X+1,$Y+5,$COLOR) DrawPixel($DC[0],$X+1,$Y+6,$COLOR) DrawPixel($DC[0],$X+1,$Y+7,$COLOR) DrawPixel($DC[0],$X+1,$Y+8,$COLOR) DrawPixel($DC[0],$X+1,$Y+9,$COLOR) DrawPixel($DC[0],$X+1,$Y+10,$COLOR) DrawPixel($DC[0],$X+1,$Y+11,$COLOR) DrawPixel($DC[0],$X+1,$Y+12,$COLOR) DrawPixel($DC[0],$X+2,$Y+2,$COLOR) DrawPixel($DC[0],$X+2,$Y+3,$COLOR) DrawPixel($DC[0],$X+2,$Y+4,$COLOR) DrawPixel($DC[0],$X+2,$Y+5,$COLOR) DrawPixel($DC[0],$X+2,$Y+6,$COLOR) DrawPixel($DC[0],$X+2,$Y+7,$COLOR) DrawPixel($DC[0],$X+2,$Y+8,$COLOR) DrawPixel($DC[0],$X+2,$Y+9,$COLOR) DrawPixel($DC[0],$X+2,$Y+10,$COLOR) DrawPixel($DC[0],$X+2,$Y+11,$COLOR) DrawPixel($DC[0],$X+2,$Y+12,$COLOR) DrawPixel($DC[0],$X+2,$Y+13,$COLOR) DrawPixel($DC[0],$X+3,$Y+1,$COLOR) DrawPixel($DC[0],$X+3,$Y+2,$COLOR) DrawPixel($DC[0],$X+3,$Y+3,$COLOR) DrawPixel($DC[0],$X+3,$Y+4,$COLOR) DrawPixel($DC[0],$X+3,$Y+5,$COLOR) DrawPixel($DC[0],$X+3,$Y+6,$COLOR) DrawPixel($DC[0],$X+3,$Y+7,$COLOR) DrawPixel($DC[0],$X+3,$Y+8,$COLOR) DrawPixel($DC[0],$X+3,$Y+9,$COLOR) DrawPixel($DC[0],$X+3,$Y+10,$COLOR) DrawPixel($DC[0],$X+3,$Y+11,$COLOR) DrawPixel($DC[0],$X+3,$Y+12,$COLOR) DrawPixel($DC[0],$X+3,$Y+13,$COLOR) DrawPixel($DC[0],$X+3,$Y+14,$COLOR) DrawPixel($DC[0],$X+4,$Y+1,$COLOR) DrawPixel($DC[0],$X+4,$Y+2,$COLOR) DrawPixel($DC[0],$X+4,$Y+3,$COLOR) DrawPixel($DC[0],$X+4,$Y+4,$COLOR) DrawPixel($DC[0],$X+4,$Y+5,$COLOR) DrawPixel($DC[0],$X+4,$Y+6,$COLOR) DrawPixel($DC[0],$X+4,$Y+7,$COLOR) DrawPixel($DC[0],$X+4,$Y+8,$COLOR) DrawPixel($DC[0],$X+4,$Y+9,$COLOR) DrawPixel($DC[0],$X+4,$Y+10,$COLOR) DrawPixel($DC[0],$X+4,$Y+11,$COLOR) DrawPixel($DC[0],$X+4,$Y+12,$COLOR) DrawPixel($DC[0],$X+4,$Y+13,$COLOR) DrawPixel($DC[0],$X+4,$Y+14,$COLOR) DrawPixel($DC[0],$X+4,$Y+15,$COLOR) DrawPixel($DC[0],$X+4,$Y+16,$COLOR) DrawPixel($DC[0],$X+5,$Y+0,$COLOR) DrawPixel($DC[0],$X+5,$Y+1,$COLOR) DrawPixel($DC[0],$X+5,$Y+2,$COLOR) DrawPixel($DC[0],$X+5,$Y+3,$COLOR) DrawPixel($DC[0],$X+5,$Y+4,$COLOR) DrawPixel($DC[0],$X+5,$Y+5,$COLOR) DrawPixel($DC[0],$X+5,$Y+6,$COLOR) DrawPixel($DC[0],$X+5,$Y+7,$COLOR) DrawPixel($DC[0],$X+5,$Y+8,$COLOR) DrawPixel($DC[0],$X+5,$Y+9,$COLOR) DrawPixel($DC[0],$X+5,$Y+10,$COLOR) DrawPixel($DC[0],$X+5,$Y+11,$COLOR) DrawPixel($DC[0],$X+5,$Y+12,$COLOR) DrawPixel($DC[0],$X+5,$Y+13,$COLOR) DrawPixel($DC[0],$X+5,$Y+14,$COLOR) DrawPixel($DC[0],$X+5,$Y+15,$COLOR) DrawPixel($DC[0],$X+5,$Y+16,$COLOR) DrawPixel($DC[0],$X+5,$Y+17,$COLOR) DrawPixel($DC[0],$X+6,$Y+0,$COLOR) DrawPixel($DC[0],$X+6,$Y+1,$COLOR) DrawPixel($DC[0],$X+6,$Y+2,$COLOR) DrawPixel($DC[0],$X+6,$Y+3,$COLOR) DrawPixel($DC[0],$X+6,$Y+4,$COLOR) DrawPixel($DC[0],$X+6,$Y+5,$COLOR) DrawPixel($DC[0],$X+6,$Y+6,$COLOR) DrawPixel($DC[0],$X+6,$Y+7,$COLOR) DrawPixel($DC[0],$X+6,$Y+8,$COLOR) DrawPixel($DC[0],$X+6,$Y+9,$COLOR) DrawPixel($DC[0],$X+6,$Y+10,$COLOR) DrawPixel($DC[0],$X+6,$Y+11,$COLOR) DrawPixel($DC[0],$X+6,$Y+12,$COLOR) DrawPixel($DC[0],$X+6,$Y+13,$COLOR) DrawPixel($DC[0],$X+6,$Y+14,$COLOR) DrawPixel($DC[0],$X+6,$Y+15,$COLOR) DrawPixel($DC[0],$X+6,$Y+16,$COLOR) DrawPixel($DC[0],$X+6,$Y+17,$COLOR) DrawPixel($DC[0],$X+6,$Y+18,$COLOR) DrawPixel($DC[0],$X+7,$Y+0,$COLOR) DrawPixel($DC[0],$X+7,$Y+1,$COLOR) DrawPixel($DC[0],$X+7,$Y+2,$COLOR) DrawPixel($DC[0],$X+7,$Y+3,$COLOR) DrawPixel($DC[0],$X+7,$Y+4,$COLOR) DrawPixel($DC[0],$X+7,$Y+5,$COLOR) DrawPixel($DC[0],$X+7,$Y+6,$COLOR) DrawPixel($DC[0],$X+7,$Y+7,$COLOR) DrawPixel($DC[0],$X+7,$Y+8,$COLOR) DrawPixel($DC[0],$X+7,$Y+9,$COLOR) DrawPixel($DC[0],$X+7,$Y+10,$COLOR) DrawPixel($DC[0],$X+7,$Y+11,$COLOR) DrawPixel($DC[0],$X+7,$Y+12,$COLOR) DrawPixel($DC[0],$X+7,$Y+13,$COLOR) DrawPixel($DC[0],$X+7,$Y+14,$COLOR) DrawPixel($DC[0],$X+7,$Y+15,$COLOR) DrawPixel($DC[0],$X+7,$Y+16,$COLOR) DrawPixel($DC[0],$X+7,$Y+17,$COLOR) DrawPixel($DC[0],$X+7,$Y+18,$COLOR) DrawPixel($DC[0],$X+8,$Y+0,$COLOR) DrawPixel($DC[0],$X+8,$Y+1,$COLOR) DrawPixel($DC[0],$X+8,$Y+2,$COLOR) DrawPixel($DC[0],$X+8,$Y+3,$COLOR) DrawPixel($DC[0],$X+8,$Y+4,$COLOR) DrawPixel($DC[0],$X+8,$Y+5,$COLOR) DrawPixel($DC[0],$X+8,$Y+6,$COLOR) DrawPixel($DC[0],$X+8,$Y+7,$COLOR) DrawPixel($DC[0],$X+8,$Y+8,$COLOR) DrawPixel($DC[0],$X+8,$Y+9,$COLOR) DrawPixel($DC[0],$X+8,$Y+10,$COLOR) DrawPixel($DC[0],$X+8,$Y+11,$COLOR) DrawPixel($DC[0],$X+8,$Y+12,$COLOR) DrawPixel($DC[0],$X+8,$Y+13,$COLOR) DrawPixel($DC[0],$X+8,$Y+14,$COLOR) DrawPixel($DC[0],$X+8,$Y+15,$COLOR) DrawPixel($DC[0],$X+8,$Y+16,$COLOR) DrawPixel($DC[0],$X+8,$Y+17,$COLOR) DrawPixel($DC[0],$X+8,$Y+18,$COLOR) DrawPixel($DC[0],$X+8,$Y+19,$COLOR) DrawPixel($DC[0],$X+8,$Y+20,$COLOR) DrawPixel($DC[0],$X+9,$Y+0,$COLOR) DrawPixel($DC[0],$X+9,$Y+1,$COLOR) DrawPixel($DC[0],$X+9,$Y+2,$COLOR) DrawPixel($DC[0],$X+9,$Y+3,$COLOR) DrawPixel($DC[0],$X+9,$Y+4,$COLOR) DrawPixel($DC[0],$X+9,$Y+5,$COLOR) DrawPixel($DC[0],$X+9,$Y+6,$COLOR) DrawPixel($DC[0],$X+9,$Y+7,$COLOR) DrawPixel($DC[0],$X+9,$Y+8,$COLOR) DrawPixel($DC[0],$X+9,$Y+9,$COLOR) DrawPixel($DC[0],$X+9,$Y+10,$COLOR) DrawPixel($DC[0],$X+9,$Y+11,$COLOR) DrawPixel($DC[0],$X+9,$Y+12,$COLOR) DrawPixel($DC[0],$X+9,$Y+13,$COLOR) DrawPixel($DC[0],$X+9,$Y+14,$COLOR) DrawPixel($DC[0],$X+9,$Y+15,$COLOR) DrawPixel($DC[0],$X+9,$Y+16,$COLOR) DrawPixel($DC[0],$X+9,$Y+17,$COLOR) DrawPixel($DC[0],$X+9,$Y+18,$COLOR) DrawPixel($DC[0],$X+9,$Y+19,$COLOR) DrawPixel($DC[0],$X+9,$Y+20,$COLOR) DrawPixel($DC[0],$X+10,$Y+1,$COLOR) DrawPixel($DC[0],$X+10,$Y+2,$COLOR) DrawPixel($DC[0],$X+10,$Y+3,$COLOR) DrawPixel($DC[0],$X+10,$Y+4,$COLOR) DrawPixel($DC[0],$X+10,$Y+5,$COLOR) DrawPixel($DC[0],$X+10,$Y+6,$COLOR) DrawPixel($DC[0],$X+10,$Y+7,$COLOR) DrawPixel($DC[0],$X+10,$Y+8,$COLOR) DrawPixel($DC[0],$X+10,$Y+9,$COLOR) DrawPixel($DC[0],$X+10,$Y+10,$COLOR) DrawPixel($DC[0],$X+10,$Y+11,$COLOR) DrawPixel($DC[0],$X+10,$Y+12,$COLOR) DrawPixel($DC[0],$X+10,$Y+13,$COLOR) DrawPixel($DC[0],$X+10,$Y+14,$COLOR) DrawPixel($DC[0],$X+10,$Y+15,$COLOR) DrawPixel($DC[0],$X+10,$Y+16,$COLOR) DrawPixel($DC[0],$X+10,$Y+17,$COLOR) DrawPixel($DC[0],$X+10,$Y+18,$COLOR) DrawPixel($DC[0],$X+10,$Y+19,$COLOR) DrawPixel($DC[0],$X+10,$Y+20,$COLOR) DrawPixel($DC[0],$X+10,$Y+21,$COLOR) DrawPixel($DC[0],$X+11,$Y+1,$COLOR) DrawPixel($DC[0],$X+11,$Y+2,$COLOR) DrawPixel($DC[0],$X+11,$Y+3,$COLOR) DrawPixel($DC[0],$X+11,$Y+4,$COLOR) DrawPixel($DC[0],$X+11,$Y+5,$COLOR) DrawPixel($DC[0],$X+11,$Y+6,$COLOR) DrawPixel($DC[0],$X+11,$Y+7,$COLOR) DrawPixel($DC[0],$X+11,$Y+8,$COLOR) DrawPixel($DC[0],$X+11,$Y+9,$COLOR) DrawPixel($DC[0],$X+11,$Y+10,$COLOR) DrawPixel($DC[0],$X+11,$Y+11,$COLOR) DrawPixel($DC[0],$X+11,$Y+12,$COLOR) DrawPixel($DC[0],$X+11,$Y+13,$COLOR) DrawPixel($DC[0],$X+11,$Y+14,$COLOR) DrawPixel($DC[0],$X+11,$Y+15,$COLOR) DrawPixel($DC[0],$X+11,$Y+16,$COLOR) DrawPixel($DC[0],$X+11,$Y+17,$COLOR) DrawPixel($DC[0],$X+11,$Y+18,$COLOR) DrawPixel($DC[0],$X+11,$Y+19,$COLOR) DrawPixel($DC[0],$X+11,$Y+20,$COLOR) DrawPixel($DC[0],$X+11,$Y+21,$COLOR) DrawPixel($DC[0],$X+11,$Y+22,$COLOR) DrawPixel($DC[0],$X+12,$Y+2,$COLOR) DrawPixel($DC[0],$X+12,$Y+3,$COLOR) DrawPixel($DC[0],$X+12,$Y+4,$COLOR) DrawPixel($DC[0],$X+12,$Y+5,$COLOR) DrawPixel($DC[0],$X+12,$Y+6,$COLOR) DrawPixel($DC[0],$X+12,$Y+7,$COLOR) DrawPixel($DC[0],$X+12,$Y+8,$COLOR) DrawPixel($DC[0],$X+12,$Y+9,$COLOR) DrawPixel($DC[0],$X+12,$Y+10,$COLOR) DrawPixel($DC[0],$X+12,$Y+11,$COLOR) DrawPixel($DC[0],$X+12,$Y+12,$COLOR) DrawPixel($DC[0],$X+12,$Y+13,$COLOR) DrawPixel($DC[0],$X+12,$Y+14,$COLOR) DrawPixel($DC[0],$X+12,$Y+15,$COLOR) DrawPixel($DC[0],$X+12,$Y+16,$COLOR) DrawPixel($DC[0],$X+12,$Y+17,$COLOR) DrawPixel($DC[0],$X+12,$Y+18,$COLOR) DrawPixel($DC[0],$X+12,$Y+19,$COLOR) DrawPixel($DC[0],$X+12,$Y+20,$COLOR) DrawPixel($DC[0],$X+12,$Y+21,$COLOR) DrawPixel($DC[0],$X+12,$Y+22,$COLOR) DrawPixel($DC[0],$X+12,$Y+23,$COLOR) DrawPixel($DC[0],$X+13,$Y+3,$COLOR) DrawPixel($DC[0],$X+13,$Y+4,$COLOR) DrawPixel($DC[0],$X+13,$Y+5,$COLOR) DrawPixel($DC[0],$X+13,$Y+6,$COLOR) DrawPixel($DC[0],$X+13,$Y+7,$COLOR) DrawPixel($DC[0],$X+13,$Y+8,$COLOR) DrawPixel($DC[0],$X+13,$Y+9,$COLOR) DrawPixel($DC[0],$X+13,$Y+10,$COLOR) DrawPixel($DC[0],$X+13,$Y+11,$COLOR) DrawPixel($DC[0],$X+13,$Y+12,$COLOR) DrawPixel($DC[0],$X+13,$Y+13,$COLOR) DrawPixel($DC[0],$X+13,$Y+14,$COLOR) DrawPixel($DC[0],$X+13,$Y+15,$COLOR) DrawPixel($DC[0],$X+13,$Y+16,$COLOR) DrawPixel($DC[0],$X+13,$Y+17,$COLOR) DrawPixel($DC[0],$X+13,$Y+18,$COLOR) DrawPixel($DC[0],$X+13,$Y+19,$COLOR) DrawPixel($DC[0],$X+13,$Y+20,$COLOR) DrawPixel($DC[0],$X+13,$Y+21,$COLOR) DrawPixel($DC[0],$X+13,$Y+22,$COLOR) DrawPixel($DC[0],$X+13,$Y+23,$COLOR) DrawPixel($DC[0],$X+13,$Y+24,$COLOR) DrawPixel($DC[0],$X+14,$Y+3,$COLOR) DrawPixel($DC[0],$X+14,$Y+4,$COLOR) DrawPixel($DC[0],$X+14,$Y+5,$COLOR) DrawPixel($DC[0],$X+14,$Y+6,$COLOR) DrawPixel($DC[0],$X+14,$Y+7,$COLOR) DrawPixel($DC[0],$X+14,$Y+8,$COLOR) DrawPixel($DC[0],$X+14,$Y+9,$COLOR) DrawPixel($DC[0],$X+14,$Y+10,$COLOR) DrawPixel($DC[0],$X+14,$Y+11,$COLOR) DrawPixel($DC[0],$X+14,$Y+12,$COLOR) DrawPixel($DC[0],$X+14,$Y+13,$COLOR) DrawPixel($DC[0],$X+14,$Y+14,$COLOR) DrawPixel($DC[0],$X+14,$Y+15,$COLOR) DrawPixel($DC[0],$X+14,$Y+16,$COLOR) DrawPixel($DC[0],$X+14,$Y+17,$COLOR) DrawPixel($DC[0],$X+14,$Y+18,$COLOR) DrawPixel($DC[0],$X+14,$Y+19,$COLOR) DrawPixel($DC[0],$X+14,$Y+20,$COLOR) DrawPixel($DC[0],$X+14,$Y+21,$COLOR) DrawPixel($DC[0],$X+14,$Y+22,$COLOR) DrawPixel($DC[0],$X+14,$Y+23,$COLOR) DrawPixel($DC[0],$X+14,$Y+24,$COLOR) DrawPixel($DC[0],$X+15,$Y+2,$COLOR) DrawPixel($DC[0],$X+15,$Y+3,$COLOR) DrawPixel($DC[0],$X+15,$Y+4,$COLOR) DrawPixel($DC[0],$X+15,$Y+5,$COLOR) DrawPixel($DC[0],$X+15,$Y+6,$COLOR) DrawPixel($DC[0],$X+15,$Y+7,$COLOR) DrawPixel($DC[0],$X+15,$Y+8,$COLOR) DrawPixel($DC[0],$X+15,$Y+9,$COLOR) DrawPixel($DC[0],$X+15,$Y+10,$COLOR) DrawPixel($DC[0],$X+15,$Y+11,$COLOR) DrawPixel($DC[0],$X+15,$Y+12,$COLOR) DrawPixel($DC[0],$X+15,$Y+13,$COLOR) DrawPixel($DC[0],$X+15,$Y+14,$COLOR) DrawPixel($DC[0],$X+15,$Y+15,$COLOR) DrawPixel($DC[0],$X+15,$Y+16,$COLOR) DrawPixel($DC[0],$X+15,$Y+17,$COLOR) DrawPixel($DC[0],$X+15,$Y+18,$COLOR) DrawPixel($DC[0],$X+15,$Y+19,$COLOR) DrawPixel($DC[0],$X+15,$Y+20,$COLOR) DrawPixel($DC[0],$X+15,$Y+21,$COLOR) DrawPixel($DC[0],$X+15,$Y+22,$COLOR) DrawPixel($DC[0],$X+15,$Y+23,$COLOR) DrawPixel($DC[0],$X+16,$Y+1,$COLOR) DrawPixel($DC[0],$X+16,$Y+2,$COLOR) DrawPixel($DC[0],$X+16,$Y+3,$COLOR) DrawPixel($DC[0],$X+16,$Y+4,$COLOR) DrawPixel($DC[0],$X+16,$Y+5,$COLOR) DrawPixel($DC[0],$X+16,$Y+6,$COLOR) DrawPixel($DC[0],$X+16,$Y+7,$COLOR) DrawPixel($DC[0],$X+16,$Y+8,$COLOR) DrawPixel($DC[0],$X+16,$Y+9,$COLOR) DrawPixel($DC[0],$X+16,$Y+10,$COLOR) DrawPixel($DC[0],$X+16,$Y+11,$COLOR) DrawPixel($DC[0],$X+16,$Y+12,$COLOR) DrawPixel($DC[0],$X+16,$Y+13,$COLOR) DrawPixel($DC[0],$X+16,$Y+14,$COLOR) DrawPixel($DC[0],$X+16,$Y+15,$COLOR) DrawPixel($DC[0],$X+16,$Y+16,$COLOR) DrawPixel($DC[0],$X+16,$Y+17,$COLOR) DrawPixel($DC[0],$X+16,$Y+18,$COLOR) DrawPixel($DC[0],$X+16,$Y+19,$COLOR) DrawPixel($DC[0],$X+16,$Y+20,$COLOR) DrawPixel($DC[0],$X+16,$Y+21,$COLOR) DrawPixel($DC[0],$X+16,$Y+22,$COLOR) DrawPixel($DC[0],$X+17,$Y+1,$COLOR) DrawPixel($DC[0],$X+17,$Y+2,$COLOR) DrawPixel($DC[0],$X+17,$Y+3,$COLOR) DrawPixel($DC[0],$X+17,$Y+4,$COLOR) DrawPixel($DC[0],$X+17,$Y+5,$COLOR) DrawPixel($DC[0],$X+17,$Y+6,$COLOR) DrawPixel($DC[0],$X+17,$Y+7,$COLOR) DrawPixel($DC[0],$X+17,$Y+8,$COLOR) DrawPixel($DC[0],$X+17,$Y+9,$COLOR) DrawPixel($DC[0],$X+17,$Y+10,$COLOR) DrawPixel($DC[0],$X+17,$Y+11,$COLOR) DrawPixel($DC[0],$X+17,$Y+12,$COLOR) DrawPixel($DC[0],$X+17,$Y+13,$COLOR) DrawPixel($DC[0],$X+17,$Y+14,$COLOR) DrawPixel($DC[0],$X+17,$Y+15,$COLOR) DrawPixel($DC[0],$X+17,$Y+16,$COLOR) DrawPixel($DC[0],$X+17,$Y+17,$COLOR) DrawPixel($DC[0],$X+17,$Y+18,$COLOR) DrawPixel($DC[0],$X+17,$Y+19,$COLOR) DrawPixel($DC[0],$X+17,$Y+20,$COLOR) DrawPixel($DC[0],$X+17,$Y+21,$COLOR) DrawPixel($DC[0],$X+18,$Y+0,$COLOR) DrawPixel($DC[0],$X+18,$Y+1,$COLOR) DrawPixel($DC[0],$X+18,$Y+2,$COLOR) DrawPixel($DC[0],$X+18,$Y+3,$COLOR) DrawPixel($DC[0],$X+18,$Y+4,$COLOR) DrawPixel($DC[0],$X+18,$Y+5,$COLOR) DrawPixel($DC[0],$X+18,$Y+6,$COLOR) DrawPixel($DC[0],$X+18,$Y+7,$COLOR) DrawPixel($DC[0],$X+18,$Y+8,$COLOR) DrawPixel($DC[0],$X+18,$Y+9,$COLOR) DrawPixel($DC[0],$X+18,$Y+10,$COLOR) DrawPixel($DC[0],$X+18,$Y+11,$COLOR) DrawPixel($DC[0],$X+18,$Y+12,$COLOR) DrawPixel($DC[0],$X+18,$Y+13,$COLOR) DrawPixel($DC[0],$X+18,$Y+14,$COLOR) DrawPixel($DC[0],$X+18,$Y+15,$COLOR) DrawPixel($DC[0],$X+18,$Y+16,$COLOR) DrawPixel($DC[0],$X+18,$Y+17,$COLOR) DrawPixel($DC[0],$X+18,$Y+18,$COLOR) DrawPixel($DC[0],$X+18,$Y+19,$COLOR) DrawPixel($DC[0],$X+18,$Y+20,$COLOR) DrawPixel($DC[0],$X+19,$Y+0,$COLOR) DrawPixel($DC[0],$X+19,$Y+1,$COLOR) DrawPixel($DC[0],$X+19,$Y+2,$COLOR) DrawPixel($DC[0],$X+19,$Y+3,$COLOR) DrawPixel($DC[0],$X+19,$Y+4,$COLOR) DrawPixel($DC[0],$X+19,$Y+5,$COLOR) DrawPixel($DC[0],$X+19,$Y+6,$COLOR) DrawPixel($DC[0],$X+19,$Y+7,$COLOR) DrawPixel($DC[0],$X+19,$Y+8,$COLOR) DrawPixel($DC[0],$X+19,$Y+9,$COLOR) DrawPixel($DC[0],$X+19,$Y+10,$COLOR) DrawPixel($DC[0],$X+19,$Y+11,$COLOR) DrawPixel($DC[0],$X+19,$Y+12,$COLOR) DrawPixel($DC[0],$X+19,$Y+13,$COLOR) DrawPixel($DC[0],$X+19,$Y+14,$COLOR) DrawPixel($DC[0],$X+19,$Y+15,$COLOR) DrawPixel($DC[0],$X+19,$Y+16,$COLOR) DrawPixel($DC[0],$X+19,$Y+17,$COLOR) DrawPixel($DC[0],$X+19,$Y+18,$COLOR) DrawPixel($DC[0],$X+19,$Y+19,$COLOR) DrawPixel($DC[0],$X+19,$Y+20,$COLOR) DrawPixel($DC[0],$X+20,$Y+0,$COLOR) DrawPixel($DC[0],$X+20,$Y+1,$COLOR) DrawPixel($DC[0],$X+20,$Y+2,$COLOR) DrawPixel($DC[0],$X+20,$Y+3,$COLOR) DrawPixel($DC[0],$X+20,$Y+4,$COLOR) DrawPixel($DC[0],$X+20,$Y+5,$COLOR) DrawPixel($DC[0],$X+20,$Y+6,$COLOR) DrawPixel($DC[0],$X+20,$Y+7,$COLOR) DrawPixel($DC[0],$X+20,$Y+8,$COLOR) DrawPixel($DC[0],$X+20,$Y+9,$COLOR) DrawPixel($DC[0],$X+20,$Y+10,$COLOR) DrawPixel($DC[0],$X+20,$Y+11,$COLOR) DrawPixel($DC[0],$X+20,$Y+12,$COLOR) DrawPixel($DC[0],$X+20,$Y+13,$COLOR) DrawPixel($DC[0],$X+20,$Y+14,$COLOR) DrawPixel($DC[0],$X+20,$Y+15,$COLOR) DrawPixel($DC[0],$X+20,$Y+16,$COLOR) DrawPixel($DC[0],$X+20,$Y+17,$COLOR) DrawPixel($DC[0],$X+20,$Y+18,$COLOR) DrawPixel($DC[0],$X+21,$Y+0,$COLOR) DrawPixel($DC[0],$X+21,$Y+1,$COLOR) DrawPixel($DC[0],$X+21,$Y+2,$COLOR) DrawPixel($DC[0],$X+21,$Y+3,$COLOR) DrawPixel($DC[0],$X+21,$Y+4,$COLOR) DrawPixel($DC[0],$X+21,$Y+5,$COLOR) DrawPixel($DC[0],$X+21,$Y+6,$COLOR) DrawPixel($DC[0],$X+21,$Y+7,$COLOR) DrawPixel($DC[0],$X+21,$Y+8,$COLOR) DrawPixel($DC[0],$X+21,$Y+9,$COLOR) DrawPixel($DC[0],$X+21,$Y+10,$COLOR) DrawPixel($DC[0],$X+21,$Y+11,$COLOR) DrawPixel($DC[0],$X+21,$Y+12,$COLOR) DrawPixel($DC[0],$X+21,$Y+13,$COLOR) DrawPixel($DC[0],$X+21,$Y+14,$COLOR) DrawPixel($DC[0],$X+21,$Y+15,$COLOR) DrawPixel($DC[0],$X+21,$Y+16,$COLOR) DrawPixel($DC[0],$X+21,$Y+17,$COLOR) DrawPixel($DC[0],$X+21,$Y+18,$COLOR) DrawPixel($DC[0],$X+22,$Y+0,$COLOR) DrawPixel($DC[0],$X+22,$Y+1,$COLOR) DrawPixel($DC[0],$X+22,$Y+2,$COLOR) DrawPixel($DC[0],$X+22,$Y+3,$COLOR) DrawPixel($DC[0],$X+22,$Y+4,$COLOR) DrawPixel($DC[0],$X+22,$Y+5,$COLOR) DrawPixel($DC[0],$X+22,$Y+6,$COLOR) DrawPixel($DC[0],$X+22,$Y+7,$COLOR) DrawPixel($DC[0],$X+22,$Y+8,$COLOR) DrawPixel($DC[0],$X+22,$Y+9,$COLOR) DrawPixel($DC[0],$X+22,$Y+10,$COLOR) DrawPixel($DC[0],$X+22,$Y+11,$COLOR) DrawPixel($DC[0],$X+22,$Y+12,$COLOR) DrawPixel($DC[0],$X+22,$Y+13,$COLOR) DrawPixel($DC[0],$X+22,$Y+14,$COLOR) DrawPixel($DC[0],$X+22,$Y+15,$COLOR) DrawPixel($DC[0],$X+22,$Y+16,$COLOR) DrawPixel($DC[0],$X+22,$Y+17,$COLOR) DrawPixel($DC[0],$X+23,$Y+1,$COLOR) DrawPixel($DC[0],$X+23,$Y+2,$COLOR) DrawPixel($DC[0],$X+23,$Y+3,$COLOR) DrawPixel($DC[0],$X+23,$Y+4,$COLOR) DrawPixel($DC[0],$X+23,$Y+5,$COLOR) DrawPixel($DC[0],$X+23,$Y+6,$COLOR) DrawPixel($DC[0],$X+23,$Y+7,$COLOR) DrawPixel($DC[0],$X+23,$Y+8,$COLOR) DrawPixel($DC[0],$X+23,$Y+9,$COLOR) DrawPixel($DC[0],$X+23,$Y+10,$COLOR) DrawPixel($DC[0],$X+23,$Y+11,$COLOR) DrawPixel($DC[0],$X+23,$Y+12,$COLOR) DrawPixel($DC[0],$X+23,$Y+13,$COLOR) DrawPixel($DC[0],$X+23,$Y+14,$COLOR) DrawPixel($DC[0],$X+23,$Y+15,$COLOR) DrawPixel($DC[0],$X+23,$Y+16,$COLOR) DrawPixel($DC[0],$X+24,$Y+1,$COLOR) DrawPixel($DC[0],$X+24,$Y+2,$COLOR) DrawPixel($DC[0],$X+24,$Y+3,$COLOR) DrawPixel($DC[0],$X+24,$Y+4,$COLOR) DrawPixel($DC[0],$X+24,$Y+5,$COLOR) DrawPixel($DC[0],$X+24,$Y+6,$COLOR) DrawPixel($DC[0],$X+24,$Y+7,$COLOR) DrawPixel($DC[0],$X+24,$Y+8,$COLOR) DrawPixel($DC[0],$X+24,$Y+9,$COLOR) DrawPixel($DC[0],$X+24,$Y+10,$COLOR) DrawPixel($DC[0],$X+24,$Y+11,$COLOR) DrawPixel($DC[0],$X+24,$Y+12,$COLOR) DrawPixel($DC[0],$X+24,$Y+13,$COLOR) DrawPixel($DC[0],$X+24,$Y+14,$COLOR) DrawPixel($DC[0],$X+25,$Y+2,$COLOR) DrawPixel($DC[0],$X+25,$Y+3,$COLOR) DrawPixel($DC[0],$X+25,$Y+4,$COLOR) DrawPixel($DC[0],$X+25,$Y+5,$COLOR) DrawPixel($DC[0],$X+25,$Y+6,$COLOR) DrawPixel($DC[0],$X+25,$Y+7,$COLOR) DrawPixel($DC[0],$X+25,$Y+8,$COLOR) DrawPixel($DC[0],$X+25,$Y+9,$COLOR) DrawPixel($DC[0],$X+25,$Y+10,$COLOR) DrawPixel($DC[0],$X+25,$Y+11,$COLOR) DrawPixel($DC[0],$X+25,$Y+12,$COLOR) DrawPixel($DC[0],$X+25,$Y+13,$COLOR) DrawPixel($DC[0],$X+26,$Y+3,$COLOR) DrawPixel($DC[0],$X+26,$Y+4,$COLOR) DrawPixel($DC[0],$X+26,$Y+5,$COLOR) DrawPixel($DC[0],$X+26,$Y+6,$COLOR) DrawPixel($DC[0],$X+26,$Y+7,$COLOR) DrawPixel($DC[0],$X+26,$Y+8,$COLOR) DrawPixel($DC[0],$X+26,$Y+9,$COLOR) DrawPixel($DC[0],$X+26,$Y+10,$COLOR) DrawPixel($DC[0],$X+26,$Y+11,$COLOR) DrawPixel($DC[0],$X+26,$Y+12,$COLOR) DrawPixel($DC[0],$X+27,$Y+5,$COLOR) DrawPixel($DC[0],$X+27,$Y+6,$COLOR) DrawPixel($DC[0],$X+27,$Y+7,$COLOR) DrawPixel($DC[0],$X+27,$Y+8,$COLOR) DrawPixel($DC[0],$X+27,$Y+9,$COLOR) DrawPixel($DC[0],$X+27,$Y+10,$COLOR) DllCall("user32.dll","int","ReleaseDC","hwnd",0,"int",$DC[0]) EndFunc Edited March 21, 2011 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
kiennv159 Posted March 21, 2011 Author Share Posted March 21, 2011 thanks saywell I need a hint like that! but it would be better if someone synthesis function to draw the image so maybe I'll have to draw my own heart! Link to comment Share on other sites More sharing options...
kiennv159 Posted March 21, 2011 Author Share Posted March 21, 2011 (edited) wow that really is impressive Thanks Andreik Edited March 21, 2011 by kiennv159 Link to comment Share on other sites More sharing options...
UEZ Posted March 21, 2011 Share Posted March 21, 2011 You can calculate also a heat expandcollapse popup;code by AndyG $user32 = DllOpen("user32.dll") $gdi32 = DllOpen("gdi32.dll") $w = 200 $h = 200 $radius = 100 $pi = 4 * ATan(1) $hgui = GUICreate("Heart", $w, $h) $bc = 0x000000 GUISetBkColor($bc, $hgui) $hdc_gui = GetDC($hgui) GUISetState() For $y = 1 To $h For $x = 1 To $w $abstand = Sqrt((($w / 2) - $x) ^ 2 + (($h / 2) - $y) ^ 2) $p = ATan2(($w / 2) - $x, ($h / 2) - $y) $l = Abs($p) / $pi $r = (13 * $l - 22 * $l ^ 2 + 10 * $l ^ 3) / (6 - 5 * $l) * $radius If $abstand <= $r Then $col = 0x0000FF Else $col = 0x000000 EndIf DllCall($gdi32, "long", "SetPixel", "long", $hdc_gui, "long", $x, "long", $y - 30, "long", $col) Next Next While GUIGetMsg() <> -3 WEnd Func atan2($y, $x) Return (2 * ATan($y / ($x + Sqrt($x * $x + $y * $y)))) EndFunc Func GetDC($handle) $dc = DllCall($user32, "int", "GetDC", "hwnd", $handle) Return $dc[0] EndFunc Br, 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 More sharing options...
UEZ Posted March 21, 2011 Share Posted March 21, 2011 Here the GDI+ version: expandcollapse popup#include <GDIPlus.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Opt('MustDeclareVars', 1) Global Const $iW = 200 Global Const $iH = 200 Global Const $radius = 100 Global Const $pi = ACos(-1) Global Const $dy = 30 Global $dist, $p, $l, $r, $col Global $hWnd = GUICreate("GDI+ Heart using Math", $iW, $iH) GUISetState() GUISetOnEvent(-3, "_Close") _GDIPlus_Startup() Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd) Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics) Global $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap) Global $hPen = _GDIPlus_PenCreate(0, 1) _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2) Draw() GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND") While Sleep(30000) WEnd Func Draw() _GDIPlus_GraphicsClear($hBackbuffer) For $y = 1 To $iH For $x = 1 To $iW $dist = Sqrt((($iW / 2) - $x) ^ 2 + (($iH / 2) - $y) ^ 2) $p = ATan2(($iW / 2) - $x, ($iH / 2) - $y) $l = Abs($p) / $pi $r = (13 * $l - 22 * $l ^ 2 + 10 * $l ^ 3) / (6 - 5 * $l) * $radius If $dist <= $r Then $col = "FF0000" Else $col = "000000" EndIf _GDIPlus_PenSetColor($hPen, "0xFF" & $col) _GDIPlus_GraphicsDrawRect($hBackbuffer, $x, $y - $dy, 1, 1, $hPen) Next _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iW, $iH) Next EndFunc Func ATan2($y, $x) Return (2 * ATan($y / ($x + Sqrt($x * $x + $y * $y)))) EndFunc Func WM_ERASEBKGND() _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iW, $iH) Return 1 EndFunc Func _Close() GUIRegisterMsg($WM_ERASEBKGND, "") _GDIPlus_PenDispose($hPen) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hBackbuffer) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() GUIDelete($hWnd) Exit EndFunc Br, 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 More sharing options...
taietel Posted March 21, 2011 Share Posted March 21, 2011 This is without GDI . I've added some gradient: expandcollapse popup#include <GUIConstantsEx.au3> $Form1 = GUICreate("Test", 210, 210) _DrawHeart(5,5,200,200) GUISetState(@SW_SHOW) While 1 Sleep(10) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _DrawHeart($iX=5, $iY=5, $iW=100, $iH=100,$iStartColour=0xff0000, $iEndColour=0xffff00) Local $Ri,$Rf,$Rs,$Gi,$Gf,$Gs,$Bi,$Bf,$Bs,$m=$iH/2 $Ri = Mod($iStartColour,256) $Gi = BitAND($iStartColour/256,255) $Bi = BitAND($iStartColour/65536,255) $Rf = Mod($iEndColour,256) $Gf = BitAND($iEndColour/256,255) $Bf = BitAND($iEndColour/65536,255) $Rs = Abs($Ri - $Rf)/$m $Gs = Abs($Gi - $Gf)/$m $Bs = Abs($Bi - $Bf)/$m If $Rf < $Ri Then $Rs = -$Rs If $Gf < $Gi Then $Gs = -$Gs If $Bf < $Bi Then $Bs = -$Bs GUICtrlCreateGraphic($iX, $iY, $iW, $iH) For $i=0 To $iW/2 Step 0.1 $Rf = $Ri + $Rs * $i $Gf = $Gi + $Gs * $i $Bf = $Bi + $Bs * $i GUICtrlSetGraphic(-1, $GUI_GR_COLOR, "0x"&Hex($Bf,2) & Hex($Gf,2) & Hex($Rf,2), "0x"&Hex($Bf,2) & Hex($Gf,2) & Hex($Rf,2)) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 1+$i, $i, $iW/2-$i, $iH/2) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, $iW/2-1, $i, $iW/2-$i, $iH/2) Next EndFunctaietel Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
UEZ Posted March 21, 2011 Share Posted March 21, 2011 @taietel very nice and fasssttt although drawing hearts is kitchy and something for girls, isn't it? The interesting part is the mathematic... Br, 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 More sharing options...
taietel Posted March 21, 2011 Share Posted March 21, 2011 Yep, I know it's girlish! But that kind of stuff gives me a strong, black coffee in the morning . I thought that if I draw two circles, move them down together a while, then towards eachother (and decreasing the diameter) will reach to the heart. It could be done with trigonometric functions, but I always go for the easy way. I've adapted the gradient from a function I've wrote some time ago.taietel Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
ChrisL Posted March 21, 2011 Share Posted March 21, 2011 How do you calculate the maths in these things, I wouldn't know where to start? [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
taietel Posted March 21, 2011 Share Posted March 21, 2011 ChrisL, in my example, I thought at these steps: http://img22.imageshack.us/i/imagine1r.jpg/ Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
kiennv159 Posted March 22, 2011 Author Share Posted March 22, 2011 things happen when going to my girlfriend's birthday, but I can not give gifts directly, I think a gift made by my hands will be very significant gift will include: United, the fly heart, the words of love ... All appears right on the Desktop, I think it will be very impressed Thanks everyone for me, "Heart", now I'm beginning the idea is then Link to comment Share on other sites More sharing options...
UEZ Posted March 22, 2011 Share Posted March 22, 2011 How do you calculate the maths in these things, I wouldn't know where to start?Here a screenshot for the calculation AndyG used: http://www.autoit.de/index.php?page=Thread&postID=208517#post208517Br,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 More sharing options...
ChrisL Posted March 22, 2011 Share Posted March 22, 2011 Thanks, still not sure I follow, The circles is a clever idea though [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
wakillon Posted December 6, 2015 Share Posted December 6, 2015 (edited) I'm a little late, but if it can help someone ...expandcollapse popup#Include <GDIPlus.au3> Global $hGui, $hGraphic, $hBrush, $aPoints $hGui = GUICreate ( 'Draw Heart Example', 500, 500 ) GUISetState() _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND ( $hGui ) $hBrush = _GDIPlus_BrushCreateSolid ( 0xFFFF0000 ) $aPoints = _HeartGetPoints ( 40, 40, 420, 420, 80 ) _GDIPlus_GraphicsFillPolygon ( $hGraphic, $aPoints, $hBrush ) While 1 Switch GUIGetMsg() Case -3 ; $GUI_EVENT_CLOSE _GDIPlus_BrushDispose ( $hBrush ) _GDIPlus_GraphicsDispose ( $hGraphic ) _GDIPlus_Shutdown() GUIDelete ( $hGui ) Exit EndSwitch Sleep ( 30 ) WEnd Func _HeartGetPoints ( $x=0, $y=0, $iWidth=100, $iHeight=100, $iPointCount=80 ) If $iPointCount < 25 Then $iPointCount = 25 Local $aPoints[$iPointCount+1][2], $k, $MaxX, $MinX, $MaxY, $MinY Local Const $fPI = ACos ( -1 ) For $i = 0 To 2*$fPi Step ( 8/$iPointCount)*$fPi/4 $k+=1 If $k > UBound ( $aPoints ) -1 Then ExitLoop $aPoints[$k][0] = 16*Sin($i)^3 $aPoints[$k][1] = 13*Cos($i)-5*Cos(2*$i)-2*Cos(3*$i)-Cos(4*$i) If $aPoints[$k][0] > $MaxX Then $MaxX = $aPoints[$k][0] If $aPoints[$k][1] > $MaxY Then $MaxY = $aPoints[$k][1] If $aPoints[$k][0] < $MinX Then $MinX = $aPoints[$k][0] If $aPoints[$k][1] < $MinY Then $MinY = $aPoints[$k][1] Next Local $w = Abs ( $MaxX ) + Abs ( $MinX ) Local $h = Abs ( $MaxY ) + Abs ( $MinY ) ; resize ( original ratio w/h : 0.965 ) For $i = 1 To UBound ( $aPoints ) -1 $aPoints[$i][0] = $x + ( $MaxX -$aPoints[$i][0] )*$iWidth/$w $aPoints[$i][1] = $y + ( $MaxY -$aPoints[$i][1] )*$iHeight/$h Next $aPoints[0][0] = UBound ( $aPoints ) -1 Return $aPoints EndFunc ;==> _HeartGetPoints() Edited December 6, 2015 by wakillon Gianni and mLipok 2 AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
mikell Posted December 6, 2015 Share Posted December 6, 2015 I admit that it's nicer than this one :#include <GUIConstantsEx.au3> $hGui = GUICreate ( 'Draw Heart Example', 500, 500 ) GuiSetFont(500, 400, 0, "Arial Unicode MS") GUICtrlCreateLabel(ChrW(9829), 0, -230, 500, 730) GUICtrlSetColor (-1, 0xff0000) GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd mLipok and jguinch 2 Link to comment Share on other sites More sharing options...
jguinch Posted December 6, 2015 Share Posted December 6, 2015 I like mikell's way : easy, fast and really shorter ! Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Gianni Posted December 7, 2015 Share Posted December 7, 2015 (edited) a simple heart from a magic number...#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Local $heart = 35880831050934, $side = 7 GUICreate('', $side * 7, $side * 7, -1, -1, $WS_POPUPWINDOW, $WS_EX_DLGMODALFRAME + $WS_EX_TOPMOST) For $i = 0 To 48 GUICtrlCreateLabel('', $side * ($i - (Int($i / 7) * 7)), $side * Int($i / 7), $side, $side, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetBkColor(-1, 0xFF0000 + (Not Int(Mod($heart, 2)) * 0x00FFFF)) $heart /= 2 Next GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Edited December 7, 2015 by Chimp Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now