Sign in to follow this  
Followers 0
CoePSX

Color Gradients Easy!

12 posts in this topic

This code isn't very fun, or useful... but it could be useful to some people.

And since making this is a headache, i'm posting it here.

I wrote this to have gradients on my MathMagic screensaver. So here it is.

It can be quite useful in some GUI windows.

In this code there are 2 functions:

RandomColor --> Generates a random color (you can limit min and max).

ColorGradient --> Generates an array containing the step colors from color A to color B

There's a small GUI example in the code, so it's easy to figure out how to use them.

#NoTrayIcon
#include <GUIConstants.au3>

;/// Settings Here ///
$NumberOfGradients = 100
$SizeOfLayer = 2
;/////////////////////

GUICreate("Gradients", $NumberOfGradients*$SizeOfLayer, 70, -1, -1)
Dim $Label[$NumberOfGradients]
For $i = 0 To $NumberOfGradients-1
    $Label[$i] = GUICtrlCreateLabel("", $i*$SizeOfLayer, 0, 10, 50)
Next
$Button = GUICtrlCreateButton("Random Gradient", 0, 50, $NumberOfGradients*$SizeOfLayer, 20)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button
            $Color = ColorGradient(RandomColor(), RandomColor(), $NumberOfGradients)
            For $i = 0 To $NumberOfGradients-1
                GUICtrlSetBkColor($Label[$i], $Color[$i])
            Next
    EndSwitch
WEnd

Func ColorGradient($hInitialColor, $hFinalColor, $iReturnSize)
    $hInitialColor = Hex($hInitialColor, 6)
    $hFinalColor = Hex($hFinalColor, 6)
    
    Local $iRed1 = Dec (StringLeft($hInitialColor, 2))
    Local $iGreen1 = Dec (StringMid($hInitialColor, 3, 2))
    Local $iBlue1 = Dec (StringMid($hInitialColor, 5, 2))
    
    Local $iRed2 = Dec (StringLeft($hFinalColor, 2))
    Local $iGreen2 = Dec (StringMid($hFinalColor, 3, 2))
    Local $iBlue2 = Dec (StringMid($hFinalColor, 5, 2))
    
    Local $iPlusRed = ($iRed2-$iRed1)/($iReturnSize-1)
    Local $iPlusBlue = ($iBlue2-$iBlue1)/($iReturnSize-1)
    Local $iPlusGreen = ($iGreen2-$iGreen1)/($iReturnSize-1)
    
    Dim $iColorArray[$iReturnSize]
    For $i = 0 To $iReturnSize-1
        $iNowRed = Floor($iRed1 + ($iPlusRed*$i))
        $iNowBlue = Floor($iBlue1 + ($iPlusBlue*$i))
        $iNowGreen = Floor($iGreen1 + ($iPlusGreen*$i))
        $iColorArray[$i] = Dec (Hex($iNowRed, 2) & Hex($iNowGreen, 2) & Hex($iNowBlue, 2))
    Next
    Return ($iColorArray)
EndFunc
Func RandomColor($hMinColor = 0x000000, $hMaxColor = 0xFFFFFF)
    $hMinColor = Hex($hMinColor, 6)
    $hMaxColor = Hex($hMaxColor, 6)
    
    Local $iRed1 = Dec (StringLeft($hMinColor, 2))
    Local $iGreen1 = Dec (StringMid($hMinColor, 3, 2))
    Local $iBlue1 = Dec (StringMid($hMinColor, 5, 2))
    
    Local $iRed2 = Dec (StringLeft($hMaxColor, 2))
    Local $iGreen2 = Dec (StringMid($hMaxColor, 3, 2))
    Local $iBlue2 = Dec (StringMid($hMaxColor, 5, 2))
    
    Local $iRndRed = Random($iRed1, $iRed2, 1)
    Local $iRndGreen = Random($iGreen1, $iGreen2, 1)
    Local $iRndBlue = Random($iBlue1, $iBlue2, 1)
    
    Return Dec (Hex($iRndRed, 2) & Hex($iRndGreen, 2) & Hex($iRndBlue, 2))
EndFunc

And the attached file for the lazy.

ColorGradient.au3


[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Share this post


Link to post
Share on other sites



cool... could be usefull for making GUI windows with fancy text? i will test it out :-)


What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites

i like it :whistle:

Share this post


Link to post
Share on other sites

yea... very usefull for gui text!


What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites

Nice! What about with a graphic Control:

#NoTrayIcon
#include <GUIConstants.au3>

;/// Settings Here ///
$NumberOfGradients = 100
$SizeOfLayer = 2
;/////////////////////

GUICreate("Gradients", $NumberOfGradients*$SizeOfLayer, 70, -1, -1)
Dim $Label[$NumberOfGradients]
$gr = GUICtrlCreateGraphic(0, 0, $NumberOfGradients*$SizeOfLayer, 20)
$Button = GUICtrlCreateButton("Random Gradient", 0, 50, $NumberOfGradients*$SizeOfLayer, 20)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button
            CreateGradient($gr, RandomColor(), RandomColor(), $NumberOfGradients, $SizeOfLayer)
    EndSwitch
WEnd
Func CreateGradient($graphic, $hInitialColor, $hFinalColor, $NumberOfGradients, $SizeOfLayer)
    $iColorArray = ColorGradient($hInitialColor, $hFinalColor, $NumberOfGradients)
    For $i = 0 To $NumberOfGradients-1
        GUICtrlSetGraphic($graphic, $GUI_GR_COLOR, $iColorArray[$i])
        For $y = 0 To 50
            For $x = $SizeOfLayer*$i-2 To $SizeOfLayer*$i
                GUICtrlSetGraphic($graphic, $GUI_GR_PIXEL, $x, $y)
            Next
        Next
    Next
    GUICtrlSetGraphic($graphic, $GUI_GR_REFRESH)    
EndFunc   ;==>CreateGradient

Func ColorGradient($hInitialColor, $hFinalColor, $iReturnSize)
    $hInitialColor = Hex($hInitialColor, 6)
    $hFinalColor = Hex($hFinalColor, 6)
    
    Local $iRed1 = Dec (StringLeft($hInitialColor, 2))
    Local $iGreen1 = Dec (StringMid($hInitialColor, 3, 2))
    Local $iBlue1 = Dec (StringMid($hInitialColor, 5, 2))
    
    Local $iRed2 = Dec (StringLeft($hFinalColor, 2))
    Local $iGreen2 = Dec (StringMid($hFinalColor, 3, 2))
    Local $iBlue2 = Dec (StringMid($hFinalColor, 5, 2))
    
    Local $iPlusRed = ($iRed2-$iRed1)/($iReturnSize-1)
    Local $iPlusBlue = ($iBlue2-$iBlue1)/($iReturnSize-1)
    Local $iPlusGreen = ($iGreen2-$iGreen1)/($iReturnSize-1)
    
    Dim $iColorArray[$iReturnSize]
    For $i = 0 To $iReturnSize-1
        $iNowRed = Floor($iRed1 + ($iPlusRed*$i))
        $iNowBlue = Floor($iBlue1 + ($iPlusBlue*$i))
        $iNowGreen = Floor($iGreen1 + ($iPlusGreen*$i))
        $iColorArray[$i] = Dec (Hex($iNowRed, 2) & Hex($iNowGreen, 2) & Hex($iNowBlue, 2))
    Next
    Return ($iColorArray)
EndFunc   ;==>ColorGradient
Func RandomColor($hMinColor = 0x000000, $hMaxColor = 0xFFFFFF)
    $hMinColor = Hex($hMinColor, 6)
    $hMaxColor = Hex($hMaxColor, 6)
    
    Local $iRed1 = Dec (StringLeft($hMinColor, 2))
    Local $iGreen1 = Dec (StringMid($hMinColor, 3, 2))
    Local $iBlue1 = Dec (StringMid($hMinColor, 5, 2))
    
    Local $iRed2 = Dec (StringLeft($hMaxColor, 2))
    Local $iGreen2 = Dec (StringMid($hMaxColor, 3, 2))
    Local $iBlue2 = Dec (StringMid($hMaxColor, 5, 2))
    
    Local $iRndRed = Random($iRed1, $iRed2, 1)
    Local $iRndGreen = Random($iGreen1, $iGreen2, 1)
    Local $iRndBlue = Random($iBlue1, $iBlue2, 1)
    
    Return Dec (Hex($iRndRed, 2) & Hex($iRndGreen, 2) & Hex($iRndBlue, 2))
EndFunc   ;==>RandomColor

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

Here's some I did a long time ago, could probably be improved upon:

; Gradient (XBox) - Graphic
#include <Color.au3>

Global $GUI_GR_LINE        = 2
Global $GUI_GR_MOVE        = 6
Global $GUI_GR_COLOR    = 8
Global Const $G_VERTICAL = 1
Global Const $G_HORIZONTAL = 2
Global Const $G_OUTSIDE_IN = 3
$color1 = 0xFFFFCC
$color2 = 0x0000CC
If Not IsDeclared('Misty_Rose') Then Dim $Misty_Rose = 0xffe4e1
If Not IsDeclared('Green') Then Dim $Green = 0x00FF00
If Not IsDeclared('Sky_Blue') Then Dim $Sky_Blue = 0x87ceeb
If Not IsDeclared('Purple') Then Dim $Purple = 0x800080
If Not IsDeclared('Black') Then Dim $Black = 0x000000
If Not IsDeclared('Yellow') Then Dim $Yellow = 0xffff00

GUICreate("Gradient Demo",500,500)
_GUICtrlCreateGradient($Black, $Green, 0, 0, 500,500,$G_OUTSIDE_IN)
;~ _GUICtrlCreateGradient($Sky_Blue, $Green, 0, 0, 500,500,$G_HORIZONTAL)

GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then Exit
Wend

Func _GUICtrlCreateGradient($nStartColor, $nEndColor, $nX, $nY, $nWidth = 255, $nHeight = 20,$n_type = 1)
   Local $colorR = _ColorGetRed($nStartColor)
   Local $colorG = _ColorGetGreen($nStartColor)
   Local $colorB = _ColorGetBlue($nStartColor)
    
   Local $nStepR,$nStepG,$nStepB

   GuiCtrlCreateGraphic($nX, $nY, $nWidth, $nHeight)
    SELECT
        Case $n_type = $G_VERTICAL
            $nStepR = (_ColorGetRed($nEndColor) - $colorR) / $nWidth
            $nStepG = (_ColorGetGreen($nEndColor) - $colorG) / $nWidth
            $nStepB = (_ColorGetBlue($nEndColor) - $colorB) / $nWidth
            For $i = 0 To $nWidth
                $sColor = "0x" & StringFormat("%02X%02X%02X", $colorR+$nStepR*$i, $colorG+$nStepG*$i, $colorB+$nStepB*$i)
                GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0xffffff)
                GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $i, 0)
                GUICtrlSetGraphic(-1, $GUI_GR_LINE, $i, $nHeight)
            Next
        Case $n_type = $G_HORIZONTAL
            $nStepR = (_ColorGetRed($nEndColor) - $colorR) / $nHeight
            $nStepG = (_ColorGetGreen($nEndColor) - $colorG) / $nHeight
            $nStepB = (_ColorGetBlue($nEndColor) - $colorB) / $nHeight
            For $i = 0 To $nHeight
                $sColor = "0x" & StringFormat("%02X%02X%02X", $colorR+$nStepR*$i, $colorG+$nStepG*$i, $colorB+$nStepB*$i)
                GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0xffffff)
                GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
                GUICtrlSetGraphic(-1, $GUI_GR_LINE, $nWidth, $i)
            Next
        Case $n_type = $G_OUTSIDE_IN
            $nStepR = (_ColorGetRed($nEndColor) - $colorR) / ($nHeight /2)
            $nStepG = (_ColorGetGreen($nEndColor) - $colorG) / ($nHeight /2)
            $nStepB = (_ColorGetBlue($nEndColor) - $colorB) / ($nHeight /2)
            If($nHeight/$nWidth > 2) Then 
                $ntHeight = $nWidth
            Else
                $ntHeight = $nHeight
            EndIf
            For $i = 0 To $ntHeight / 2
                $sColor = "0x" & StringFormat("%02X%02X%02X", $colorR+$nStepR*$i, $colorG+$nStepG*$i, $colorB+$nStepB*$i)
; top
                GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0xffffff)
                GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $nX + $i, $nY + $i)
                GUICtrlSetGraphic(-1, $GUI_GR_LINE, $nX + ($nWidth - $i), $nY + $i)
; bottom
                GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0xffffff)
                GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $nx + $i, ($nHeight - $i) + $nY)
                GUICtrlSetGraphic(-1, $GUI_GR_LINE, $nX + ($nWidth - $i), $nY + ($nHeight - $i))
            Next
    
            $nStepR = (_ColorGetRed($nEndColor) - $colorR) / ($nWidth /2)
            $nStepG = (_ColorGetGreen($nEndColor) - $colorG) / ($nWidth /2)
            $nStepB = (_ColorGetBlue($nEndColor) - $colorB) / ($nWidth /2)
            If($nWidth/$nHeight > 2) Then 
                $ntWidth = $nHeight
            Else
                $ntWidth = $nWidth
            EndIf
            For $i = 0 To $ntWidth / 2
                $sColor = "0x" & StringFormat("%02X%02X%02X", $colorR+$nStepR*$i, $colorG+$nStepG*$i, $colorB+$nStepB*$i)
; left
                GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0xffffff)
                GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $nX + $i, $nY + $i)
                GUICtrlSetGraphic(-1, $GUI_GR_LINE, $nX + $i, $nY + ($nHeight - $i))
; right
                GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0xffffff)
                GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $nX + ($nWidth - $i), $nY + $i)
                GUICtrlSetGraphic(-1, $GUI_GR_LINE, $nX + ($nWidth - $i), $nY + ($nHeight - $i))
            Next
    EndSelect
 EndFunc
oÝ÷ Ù«­¢+Ø(ìÉ¥¹ÐÈ´ÉÁ¡¥(¥¹±Õ±ÐíÕ¥
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±Ðí
½±½È¹ÔÌÐì((íø±½°ÀÌØíU%}I}1%9ôÈ(íø±½°ÀÌØíU%}I}5=YôØ(íø±½°ÀÌØíU%}I}
=1=Hôà)±½°
½¹ÍÐÀÌØí}YIQ%
0ôÄ)±½°
½¹ÍÐÀÌØí}!=I%i=9Q0ôÈ)±½°
½¹ÍÐÀÌØí}=UQM%}%8ôÌ()%9½Ð%걃 Ìäí5¥ÍÑå}I½ÍÌäì¤Q¡¸¥´ÀÌØí5¥ÍÑå}I½ÍôÁáÑÄ)%9½Ð%걃 ÌäíɸÌäì¤Q¡¸¥´ÀÌØíɸôÁàÀÁÀÀ)%9½Ð%걃 ÌäíM­å} ±ÕÌäì¤Q¡¸¥´ÀÌØíM­å} ±ÕôÁààÝ)%9½Ð%걃 ÌäíAÕÉÁ±Ìäì¤Q¡¸¥´ÀÌØíAÕÉÁ±ôÁààÀÀÀàÀ)%9½Ð%걃 Ìäí   ±¬Ìäì¤Q¡¸¥´ÀÌØí   ±¬ôÁàÀÀÀÀÀÀ)%9½Ð%걃 Ìäíe±±½ÜÌäì¤Q¡¸¥´ÀÌØíe±±½ÜôÁáÀÀ)%9½Ð%걃 ÌäíÉ­}ɸÌäì¤Q¡¸¥´ÀÌØíÉ­}ɸôÁàÀÀØÐÀÀ()9½Ð%걃 ÅÕ½ÐíU%}]¥Ñ ÅÕ½Ð줤Q¡¸±½°
½¹ÍÐÀÌØíU%}]¥Ñ ôÔÀÀ)9½Ð%걃 ÅÕ½ÐíU%}!¥¡ÐÅÕ½Ð줤Q¡¸±½°
½¹ÍÐÀÌØíU%}!¥¡ÐôÔÀÀ)9½Ð%걃 ÅÕ½Ðí   Q9}]¥Ñ ÅÕ½Ð줤Q¡¸±½°
½¹ÍÐÀÌØí    Q9}]¥Ñ ôàÀ)9½Ð%걃 ÅÕ½Ðí  Q9}!¥¡ÐÅÕ½Ð줤Q¡¸±½°
½¹ÍÐÀÌØí    Q9}!¥¡ÐôÐÀ()¥´ÀÌØí  ÕÑѽ¹|Ä°ÀÌØí ÕÑѽ¹|È°ÀÌØí ÕÑѽ¹|Ì°ÀÌØí ÕÑѽ¹|Ð((ÀÌØíU%}]%8ô
ÉÑ]¥¹½Ü ¤)}U%
Ñɱ
ÉÑÉ¥¹Ð ÀÌØíAÕÉÁ±°ÀÌØí5¥ÍÑå}I½Í°À°À°ÀÌØíU%}]¥Ñ °ÀÌØíU%}!¥¡Ð°ÀÌØí}YIQ%
0¤)U%MÑMÑÑ ¤(()]¡¥±Ä(ÀÌØíµÍôU%Ñ5Í ¤(%M±Ð(%
ÍÀÌØíµÍôÀÌØí    ÕÑѽ¹|Ä($%á¥Ñ1½½À(%
ÍÀÌØíµÍôÀÌØí    ÕÑѽ¹|È($%U%±Ñ ÀÌØíU%}]%8¤($$ÀÌØíU%}]%8ô
ÉÑ]¥¹½Ü ¤($%}U%
Ñɱ
ÉÑÉ¥¹Ð ÀÌØí   ±¬°ÀÌØíe±±½Ü°À°À°ÀÌØíU%}]¥Ñ °ÀÌØíU%}!¥¡Ð°ÀÌØí}=UQM%}%8¤($%U%MÑMÑÑ ¤(%
ÍÀÌØíµÍôÀÌØí    ÕÑѽ¹|Ì($%U%±Ñ ÀÌØíU%}]%8¤($$ÀÌØíU%}]%8ô
ÉÑ]¥¹½Ü ¤($%}U%
Ñɱ
ÉÑÉ¥¹ÑQÉ¥
½±½È ÀÌØíM­å} ±Õ°ÀÌØí5¥ÍÑå}I½Í°ÀÌØíɸ°À°À°ÀÌØíU%}]¥Ñ °ÀÌØíU%}!¥¡Ð°ÀÌØí}!=I%i=9Q0¤($%U%MÑMÑÑ ¤(%
ÍÀÌØíµÍôÀÌØí    ÕÑѽ¹|Ð($%U%±Ñ ÀÌØíU%}]%8¤($$ÀÌØíU%}]%8ô
ÉÑ]¥¹½Ü ¤($%}U%
Ñɱ
ÉÑÉ¥¹ÑQÉ¥
½±½È ÀÌØí   ±¬°ÀÌØíAÕÉÁ±°ÀÌØíɸ°À°À°ÀÌØíU%}]¥Ñ °ÀÌØíU%}!¥¡Ð°ÀÌØí}!=I%i=9Q0¤($%U%MÑMÑÑ ¤(%
ÍÀÌØíµÍôÀÌØíU%}Y9Q}
1=M($%á¥Ñ1½½À(%¹M±Ð)]¹()Õ¹
ÉÑ]¥¹½Ü ¤(ÀÌØí¡Ý¹ôÕ¥
ÉÑ ÅÕ½ÐíÉ¥¹Ðµ¼ÅÕ½Ðì°ÀÌØíU%}]¥Ñ °ÀÌØíU%}!¥¡Ð°¡Í­Ñ½Á]¥Ñ ´ÀÌØíU%}]¥Ñ ¤¼È°¡Í­Ñ½Á!¥¡Ð´ÀÌØíU%}!¥¡Ð¤¼È°ÀÌØí]M}=YI1AA]%9=¬ÀÌØí]M}
1%AM%   1%9L¤((ÀÌØí    ÕÑѽ¹|ÄôÕ¥
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½Ðíá¥ÐÅÕ½Ðì°ÀÌØíU%}]¥Ñ ´ ÀÌØí Q9}]¥Ñ ¬ÈÀ¤°ÀÌØíU%}!¥¡Ð´ ÀÌØí    Q9}!¥¡Ð¬ÈÀ¤°ÀÌØí    Q9}]¥Ñ °ÀÌØí Q9}!¥¡Ð¤(ÀÌØí   ÕÑѽ¹|ÈôÕ¥
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½Ðía  ½àÅÕ½Ðì°ÄÀ°ÀÌØíU%}!¥¡Ð´ ÀÌØí Q9}!¥¡Ð¬ÄÈÀ¤°ÀÌØí  Q9}]¥Ñ °ÀÌØí Q9}!¥¡Ð¤(ÀÌØí   ÕÑѽ¹|ÌôÕ¥
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½ÐíM­ä½ÉÍÌÅÕ½Ðì°ÄÀ°ÀÌØíU%}!¥¡Ð´ ÀÌØí   Q9}!¥¡Ð¬ÜÀ¤°ÀÌØí    Q9}]¥Ñ °ÀÌØí Q9}!¥¡Ð¤(ÀÌØí   ÕÑѽ¹|ÐôÕ¥
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½Ðí9¥¡ÐM­äüÅÕ½Ðì°ÄÀ°ÀÌØíU%}!¥¡Ð´ ÀÌØí  Q9}!¥¡Ð¬ÈÀ¤°ÀÌØí    Q9}]¥Ñ °ÀÌØí Q9}!¥¡Ð¤)IÑÕɸÀÌØí¡Ý¹)¹Õ¹()Õ¹}U%
Ñɱ
ÉÑÉ¥¹Ð ÀÌØí¹MÑÉÑ
½±½È°ÀÌØí¹¹
½±½È°ÀÌØí¹`°ÀÌØí¹d°ÀÌØí¹]¥Ñ ôÈÔÔ°ÀÌØí¹!¥¡ÐôÈÀ°ÀÌØí¹}ÑåÁôĤ(1½°ÀÌØí½±½ÉHô}
½±½ÉÑI ÀÌØí¹MÑÉÑ
½±½È¤(1½°ÀÌØí½±½Éô}
½±½ÉÑɸ ÀÌØí¹MÑÉÑ
½±½È¤(1½°ÀÌØí½±½Éô}
½±½ÉÑ  ±Õ ÀÌØí¹MÑÉÑ
½±½È¤($(1½°ÀÌØí¹MÑÁH°ÀÌØí¹MÑÁ°ÀÌØí¹MÑÁ((Õ¥
Ñɱ
ÉÑÉÁ¡¥ ÀÌØí¹`°ÀÌØí¹d°ÀÌØí¹]¥Ñ °ÀÌØí¹!¥¡Ð¤(%M1
P($%
ÍÀÌØí¹}ÑåÁôÀÌØí}YIQ%
0($$$ÀÌØí¹MÑÁHô¡}
½±½ÉÑI ÀÌØí¹¹
½±½È¤´ÀÌØí½±½ÉH¤¼ÀÌØí¹]¥Ñ ($$$ÀÌØí¹MÑÁô¡}
½±½ÉÑɸ ÀÌØí¹¹
½±½È¤´ÀÌØí½±½É¤¼ÀÌØí¹]¥Ñ ($$$ÀÌØí¹MÑÁô¡}
½±½ÉÑ  ±Õ ÀÌØí¹¹
½±½È¤´ÀÌØí½±½É¤¼ÀÌØí¹]¥Ñ ($$%½ÈÀÌØí¤ôÀQ¼ÀÌØí¹]¥Ñ ($$$$ÀÌØíÍ
½±½ÈôÅÕ½ÐìÁàÅÕ½ÐìµÀìMÑÉ¥¹½ÉµÐ ÅÕ½ÐìÀÉ`ÀÉ`ÀÉ`ÅÕ½Ðì°ÀÌØí½±½ÉH¬ÀÌØí¹MÑÁH¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}
=1=H°ÀÌØíÍ
½±½È°Áá¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}5=Y°ÀÌØí¤°À¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}1%9°ÀÌØí¤°ÀÌØí¹!¥¡Ð¤($$%9áÐ($%
ÍÀÌØí¹}ÑåÁôÀÌØí}!=I%i=9Q0($$$ÀÌØí¹MÑÁHô¡}
½±½ÉÑI ÀÌØí¹¹
½±½È¤´ÀÌØí½±½ÉH¤¼ÀÌØí¹!¥¡Ð($$$ÀÌØí¹MÑÁô¡}
½±½ÉÑɸ ÀÌØí¹¹
½±½È¤´ÀÌØí½±½É¤¼ÀÌØí¹!¥¡Ð($$$ÀÌØí¹MÑÁô¡}
½±½ÉÑ  ±Õ ÀÌØí¹¹
½±½È¤´ÀÌØí½±½É¤¼ÀÌØí¹!¥¡Ð($$%½ÈÀÌØí¤ôÀQ¼ÀÌØí¹!¥¡Ð($$$$ÀÌØíÍ
½±½ÈôÅÕ½ÐìÁàÅÕ½ÐìµÀìMÑÉ¥¹½ÉµÐ ÅÕ½ÐìÀÉ`ÀÉ`ÀÉ`ÅÕ½Ðì°ÀÌØí½±½ÉH¬ÀÌØí¹MÑÁH¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}
=1=H°ÀÌØíÍ
½±½È°Áá¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}5=Y°À°ÀÌØí¤¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}1%9°ÀÌØí¹]¥Ñ °ÀÌØí¤¤($$%9áÐ($%
ÍÀÌØí¹}ÑåÁôÀÌØí}=UQM%}%8($$$ÀÌØí¹MÑÁHô¡}
½±½ÉÑI ÀÌØí¹¹
½±½È¤´ÀÌØí½±½ÉH¤¼ ÀÌØí¹!¥¡Ð¼È¤($$$ÀÌØí¹MÑÁô¡}
½±½ÉÑɸ ÀÌØí¹¹
½±½È¤´ÀÌØí½±½É¤¼ ÀÌØí¹!¥¡Ð¼È¤($$$ÀÌØí¹MÑÁô¡}
½±½ÉÑ  ±Õ ÀÌØí¹¹
½±½È¤´ÀÌØí½±½É¤¼ ÀÌØí¹!¥¡Ð¼È¤($$%% ÀÌØí¹!¥¡Ð¼ÀÌØí¹]¥Ñ ÐìȤQ¡¸($$$$ÀÌØí¹Ñ!¥¡ÐôÀÌØí¹]¥Ñ ($$%±Í($$$$ÀÌØí¹Ñ!¥¡ÐôÀÌØí¹!¥¡Ð($$%¹%($$%½ÈÀÌØí¤ôÀQ¼ÀÌØí¹Ñ!¥¡Ð¼È($$$$ÀÌØíÍ
½±½ÈôÅÕ½ÐìÁàÅÕ½ÐìµÀìMÑÉ¥¹½ÉµÐ ÅÕ½ÐìÀÉ`ÀÉ`ÀÉ`ÅÕ½Ðì°ÀÌØí½±½ÉH¬ÀÌØí¹MÑÁH¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤¤($ìѽÀ($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}
=1=H°ÀÌØíÍ
½±½È°Áá¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}5=Y°ÀÌØí¹`¬ÀÌØí¤°ÀÌØí¹d¬ÀÌØí¤¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}1%9°ÀÌØí¹`¬ ÀÌØí¹]¥Ñ ´ÀÌØí¤¤°ÀÌØí¹d¬ÀÌØí¤¤($ì½Ñѽ´($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}
=1=H°ÀÌØíÍ
½±½È°Áá¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}5=Y°ÀÌØí¹à¬ÀÌØí¤° ÀÌØí¹!¥¡Ð´ÀÌØí¤¤¬ÀÌØí¹d¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}1%9°ÀÌØí¹`¬ ÀÌØí¹]¥Ñ ´ÀÌØí¤¤°ÀÌØí¹d¬ ÀÌØí¹!¥¡Ð´ÀÌØí¤¤¤($$%9áÐ($($$$ÀÌØí¹MÑÁHô¡}
½±½ÉÑI ÀÌØí¹¹
½±½È¤´ÀÌØí½±½ÉH¤¼ ÀÌØí¹]¥Ñ ¼È¤($$$ÀÌØí¹MÑÁô¡}
½±½ÉÑɸ ÀÌØí¹¹
½±½È¤´ÀÌØí½±½É¤¼ ÀÌØí¹]¥Ñ ¼È¤($$$ÀÌØí¹MÑÁô¡}
½±½ÉÑ  ±Õ ÀÌØí¹¹
½±½È¤´ÀÌØí½±½É¤¼ ÀÌØí¹]¥Ñ ¼È¤($$%% ÀÌØí¹]¥Ñ ¼ÀÌØí¹!¥¡ÐÐìȤQ¡¸($$$$ÀÌØí¹Ñ]¥Ñ ôÀÌØí¹!¥¡Ð($$%±Í($$$$ÀÌØí¹Ñ]¥Ñ ôÀÌØí¹]¥Ñ ($$%¹%($$%½ÈÀÌØí¤ôÀQ¼ÀÌØí¹Ñ]¥Ñ ¼È($$$$ÀÌØíÍ
½±½ÈôÅÕ½ÐìÁàÅÕ½ÐìµÀìMÑÉ¥¹½ÉµÐ ÅÕ½ÐìÀÉ`ÀÉ`ÀÉ`ÅÕ½Ðì°ÀÌØí½±½ÉH¬ÀÌØí¹MÑÁH¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤¤($ì±Ð($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}
=1=H°ÀÌØíÍ
½±½È°Áá¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}5=Y°ÀÌØí¹`¬ÀÌØí¤°ÀÌØí¹d¬ÀÌØí¤¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}1%9°ÀÌØí¹`¬ÀÌØí¤°ÀÌØí¹d¬ ÀÌØí¹!¥¡Ð´ÀÌØí¤¤¤($ìÉ¥¡Ð($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}
=1=H°ÀÌØíÍ
½±½È°Áá¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}5=Y°ÀÌØí¹`¬ ÀÌØí¹]¥Ñ ´ÀÌØí¤¤°ÀÌØí¹d¬ÀÌØí¤¤($$$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}1%9°ÀÌØí¹`¬ ÀÌØí¹]¥Ñ ´ÀÌØí¤¤°ÀÌØí¹d¬ ÀÌØí¹!¥¡Ð´ÀÌØí¤¤¤($$%9áÐ(%¹M±Ð)¹Õ¹()Õ¹}U%
Ñɱ
ÉÑÉ¥¹ÑQÉ¥
½±½È ÀÌØí¹MÑÉÑ
½±½È°ÀÌØí¹¹
½±½ÈÄ°ÀÌØí¹¹
½±½ÈÈ°ÀÌØí¹`°ÀÌØí¹d°ÀÌØí¹]¥Ñ ôÈÔÔ°ÀÌØí¹!¥¡ÐôÈÀ°ÀÌØí¹}ÑåÁôĤ(%1½°ÀÌØí¹MÑÁH°ÀÌØí¹MÑÁ°ÀÌØí¹MÑÁ(%1½°ÀÌØí½±½ÉHô}
½±½ÉÑI ÀÌØí¹MÑÉÑ
½±½È¤(%1½°ÀÌØí½±½Éô}
½±½ÉÑɸ ÀÌØí¹MÑÉÑ
½±½È¤(%1½°ÀÌØí½±½Éô}
½±½ÉÑ  ±Õ ÀÌØí¹MÑÉÑ
½±½È¤((%% ÀÌØí¹}ÑåÁôôÀÌØí}YIQ%
0¤Q¡¸($%Õ¥
Ñɱ
ÉÑÉÁ¡¥ ÀÌØí¹`°ÀÌØí¹d°ÀÌØí¹]¥Ñ ¼È°ÀÌØí¹!¥¡Ð¤($$ÀÌØí¹MÑÁHô¡}
½±½ÉÑI ÀÌØí¹¹
½±½ÈĤ´ÀÌØí½±½ÉH¤¼ ÀÌØí¹]¥Ñ ¼È¤($$ÀÌØí¹MÑÁô¡}
½±½ÉÑɸ ÀÌØí¹¹
½±½ÈĤ´ÀÌØí½±½É¤¼ ÀÌØí¹]¥Ñ ¼È¤($$ÀÌØí¹MÑÁô¡}
½±½ÉÑ  ±Õ ÀÌØí¹¹
½±½ÈĤ´ÀÌØí½±½É¤¼ ÀÌØí¹]¥Ñ ¼È¤($%½ÈÀÌØí¤ôÀQ¼ÀÌØí¹]¥Ñ ¼È($$$ÀÌØíÍ
½±½ÈôÅÕ½ÐìÁàÅÕ½ÐìµÀìMÑÉ¥¹½ÉµÐ ÅÕ½ÐìÀÉ`ÀÉ`ÀÉ`ÅÕ½Ðì°ÀÌØí½±½ÉH¬ÀÌØí¹MÑÁH¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤¤($$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}
=1=H°ÀÌØíÍ
½±½È°Áá¤($$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}5=Y°ÀÌØí¤°À¤($$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}1%9°ÀÌØí¤°ÀÌØí¹!¥¡Ð¤($%9áÐ($%Õ¥
Ñɱ
ÉÑÉÁ¡¥ ÀÌØí¹`¬ ÀÌØí¹]¥Ñ ¼È¤°ÀÌØí¹d°ÀÌØí¹]¥Ñ ¼È°ÀÌØí¹!¥¡Ð¤($$ÀÌØí½±½ÉHô}
½±½ÉÑI ÀÌØí¹¹
½±½ÈĤ($$ÀÌØí½±½Éô}
½±½ÉÑɸ ÀÌØí¹¹
½±½ÈĤ($$ÀÌØí½±½Éô}
½±½ÉÑ  ±Õ ÀÌØí¹¹
½±½ÈĤ($$ÀÌØí¹MÑÁHô¡}
½±½ÉÑI ÀÌØí¹¹
½±½ÈȤ´ÀÌØí½±½ÉH¤¼ ÀÌØí¹]¥Ñ ¼È¤($$ÀÌØí¹MÑÁô¡}
½±½ÉÑɸ ÀÌØí¹¹
½±½ÈȤ´ÀÌØí½±½É¤¼ ÀÌØí¹]¥Ñ ¼È¤($$ÀÌØí¹MÑÁô¡}
½±½ÉÑ  ±Õ ÀÌØí¹¹
½±½ÈȤ´ÀÌØí½±½É¤¼ ÀÌØí¹]¥Ñ ¼È¤($%½ÈÀÌØí¤ôÀQ¼ÀÌØí¹]¥Ñ ¼È($$$ÀÌØíÍ
½±½ÈôÅÕ½ÐìÁàÅÕ½ÐìµÀìMÑÉ¥¹½ÉµÐ ÅÕ½ÐìÀÉ`ÀÉ`ÀÉ`ÅÕ½Ðì°ÀÌØí½±½ÉH¬ÀÌØí¹MÑÁH¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤¤($$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}
=1=H°ÀÌØíÍ
½±½È°Áá¤($$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}5=Y°ÀÌØí¤°À¤($$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}1%9°ÀÌØí¤°ÀÌØí¹!¥¡Ð¤($%9áÐ(%±Í% ÀÌØí¹}ÑåÁôôÀÌØí}!=I%i=9Q0¤Q¡¸($%Õ¥
Ñɱ
ÉÑÉÁ¡¥ ÀÌØí¹`°ÀÌØí¹d°ÀÌØí¹]¥Ñ °ÀÌØí¹!¥¡Ð¼È¤($$ÀÌØí¹MÑÁHô¡}
½±½ÉÑI ÀÌØí¹¹
½±½ÈĤ´ÀÌØí½±½ÉH¤¼ ÀÌØí¹!¥¡Ð¼È¤($$ÀÌØí¹MÑÁô¡}
½±½ÉÑɸ ÀÌØí¹¹
½±½ÈĤ´ÀÌØí½±½É¤¼ ÀÌØí¹!¥¡Ð¼È¤($$ÀÌØí¹MÑÁô¡}
½±½ÉÑ  ±Õ ÀÌØí¹¹
½±½ÈĤ´ÀÌØí½±½É¤¼ ÀÌØí¹!¥¡Ð¼È¤($%½ÈÀÌØí¤ôÀQ¼ÀÌØí¹!¥¡Ð¼È($$$ÀÌØíÍ
½±½ÈôÅÕ½ÐìÁàÅÕ½ÐìµÀìMÑÉ¥¹½ÉµÐ ÅÕ½ÐìÀÉ`ÀÉ`ÀÉ`ÅÕ½Ðì°ÀÌØí½±½ÉH¬ÀÌØí¹MÑÁH¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤¤($$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}
=1=H°ÀÌØíÍ
½±½È°Áá¤($$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}5=Y°À°ÀÌØí¤¤($$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}1%9°ÀÌØí¹]¥Ñ °ÀÌØí¤¤($%9áÐ($%Õ¥
Ñɱ
ÉÑÉÁ¡¥ ÀÌØí¹`°ÀÌØí¹d¬ ÀÌØí¹!¥¡Ð¼È¤°ÀÌØí¹]¥Ñ °ÀÌØí¹!¥¡Ð¼È¤($$ÀÌØí½±½ÉHô}
½±½ÉÑI ÀÌØí¹¹
½±½ÈĤ($$ÀÌØí½±½Éô}
½±½ÉÑɸ ÀÌØí¹¹
½±½ÈĤ($$ÀÌØí½±½Éô}
½±½ÉÑ  ±Õ ÀÌØí¹¹
½±½ÈĤ($$ÀÌØí¹MÑÁHô¡}
½±½ÉÑI ÀÌØí¹¹
½±½ÈȤ´ÀÌØí½±½ÉH¤¼ ÀÌØí¹!¥¡Ð¼È¤($$ÀÌØí¹MÑÁô¡}
½±½ÉÑɸ ÀÌØí¹¹
½±½ÈȤ´ÀÌØí½±½É¤¼ ÀÌØí¹!¥¡Ð¼È¤($$ÀÌØí¹MÑÁô¡}
½±½ÉÑ  ±Õ ÀÌØí¹¹
½±½ÈȤ´ÀÌØí½±½É¤¼ ÀÌØí¹!¥¡Ð¼È¤($%½ÈÀÌØí¤ôÀQ¼ÀÌØí¹!¥¡Ð¼È($$$ÀÌØíÍ
½±½ÈôÅÕ½ÐìÁàÅÕ½ÐìµÀìMÑÉ¥¹½ÉµÐ ÅÕ½ÐìÀÉ`ÀÉ`ÀÉ`ÅÕ½Ðì°ÀÌØí½±½ÉH¬ÀÌØí¹MÑÁH¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤°ÀÌØí½±½É¬ÀÌØí¹MÑÁ¨ÀÌØí¤¤($$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}
=1=H°ÀÌØíÍ
½±½È°Áá¤($$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}5=Y°À°ÀÌØí¤¤($$%U%
ÑɱMÑÉÁ¡¥ ´Ä°ÀÌØíU%}I}1%9°ÀÌØí¹]¥Ñ °ÀÌØí¤¤($%9áÐ(%¹%)¹Õ¹(

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

:whistle: gafrost's xbox gradient is awesome!!!

What an amazing piece of code!


[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Share this post


Link to post
Share on other sites

@Gafrost your 2 scripts are "AMAZING!!!!" They are so COOL


My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!

Share this post


Link to post
Share on other sites

Little script to make cone graphics. (i don't know if that's the right word in english.)

#NoTrayIcon
#include <GUIConstants.au3>

Global Const $Pi = 3.1415926535897932384626433832795
$USER32 = DllOpen("user32.dll")
$GDI32 = DllOpen("gdi32.dll")

$Window = GUICreate("Gradient Circle", 200, 230, -1, -1)
$Mover = GUICtrlCreateLabel("", 0, 0, 200, 200, -1, $GUI_WS_EX_PARENTDRAG)
$Button = GUICtrlCreateButton("Random Gradient", 0, 200, 200, 30)

;$ret = DllCall($GDI32, "int", "CreateRoundRectRgn", "int", 0, "int", 30, "int", 200, "int", 230, "int", 200, "int", 200)
;$ret2 = DllCall($GDI32, "int", "CreateRectRgn", "int", 4, "int", 230, "int", 202, "int", 258, "int", 0)
;DllCall($GDI32, "int", "CombineRgn", "hwnd", $ret[0], "hwnd", $ret2[0], "hwnd", $ret[0], "int", 2)
;DllCall($USER32, "long", "SetWindowRgn", "hwnd", $Window, "long", $ret[0], "int", 1)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button
            CreateGradient()
    EndSwitch
WEnd

Func CreateGradient()
    GUISetBkColor(0xFFFFFF)
    $GUIHDC = DllCall ($USER32, "int", "GetDC", "hwnd", $Window)
    
    $Color1 = RandomColor()
    $Color2 = RandomColor()
    
    $Color = ColorGradient($Color1, $Color2, 180)
    For $i = 0 To 179
        $X = Sin($i*($Pi/180)) * 100 + 100
        $Y= Cos($i*($Pi/180)) * 100 + 100
        $Pen = DllCall($GDI32, "hwnd", "CreatePen", "int", 0, "int", 3, "hwnd", $Color[$i])
        DllCall($GDI32, "hwnd", "SelectObject", "hwnd", $GUIHDC[0], "hwnd", $Pen[0])
        DllCall ($GDI32, "int", "MoveToEx", "hwnd", $GUIHDC[0], "int", 100, "int", 100, "ptr", 0)
        DllCall ($GDI32, "int", "LineTo", "hwnd", $GUIHDC[0], "int", $X, "int", $Y)
    Next
    $Color = ColorGradient($Color2, $Color1, 180)
    For $i = 180 To 359
        $X = Sin($i*($Pi/180)) * 100 + 100
        $Y= Cos($i*($Pi/180)) * 100 + 100
        $Pen = DllCall($GDI32, "hwnd", "CreatePen", "int", 0, "int", 3, "hwnd", $Color[$i-180])
        DllCall($GDI32, "hwnd", "SelectObject", "hwnd", $GUIHDC[0], "hwnd", $Pen[0])
        DllCall ($GDI32, "int", "MoveToEx", "hwnd", $GUIHDC[0], "int", 100, "int", 100, "ptr", 0)
        DllCall ($GDI32, "int", "LineTo", "hwnd", $GUIHDC[0], "int", $X, "int", $Y)
    Next
    
    DllCall ($USER32,"int","ReleaseDC","int",$GUIHDC[0],"hwnd",$Window)
EndFunc   ;==>CreateGradient
Func ColorGradient($hInitialColor, $hFinalColor, $iReturnSize)
    $hInitialColor = Hex($hInitialColor, 6)
    $hFinalColor = Hex($hFinalColor, 6)
    
    Local $iRed1 = Dec (StringLeft($hInitialColor, 2))
    Local $iGreen1 = Dec (StringMid($hInitialColor, 3, 2))
    Local $iBlue1 = Dec (StringMid($hInitialColor, 5, 2))
    
    Local $iRed2 = Dec (StringLeft($hFinalColor, 2))
    Local $iGreen2 = Dec (StringMid($hFinalColor, 3, 2))
    Local $iBlue2 = Dec (StringMid($hFinalColor, 5, 2))
    
    Local $iPlusRed = ($iRed2-$iRed1)/($iReturnSize-1)
    Local $iPlusBlue = ($iBlue2-$iBlue1)/($iReturnSize-1)
    Local $iPlusGreen = ($iGreen2-$iGreen1)/($iReturnSize-1)
    
    Dim $iColorArray[$iReturnSize]
    For $i = 0 To $iReturnSize-1
        $iNowRed = Floor($iRed1 + ($iPlusRed*$i))
        $iNowBlue = Floor($iBlue1 + ($iPlusBlue*$i))
        $iNowGreen = Floor($iGreen1 + ($iPlusGreen*$i))
        $iColorArray[$i] = Dec (Hex($iNowRed, 2) & Hex($iNowGreen, 2) & Hex($iNowBlue, 2))
    Next
    Return ($iColorArray)
EndFunc   ;==>ColorGradient
Func RandomColor($hMinColor = 0x000000, $hMaxColor = 0xFFFFFF)
    $hMinColor = Hex($hMinColor, 6)
    $hMaxColor = Hex($hMaxColor, 6)
    
    Local $iRed1 = Dec (StringLeft($hMinColor, 2))
    Local $iGreen1 = Dec (StringMid($hMinColor, 3, 2))
    Local $iBlue1 = Dec (StringMid($hMinColor, 5, 2))
    
    Local $iRed2 = Dec (StringLeft($hMaxColor, 2))
    Local $iGreen2 = Dec (StringMid($hMaxColor, 3, 2))
    Local $iBlue2 = Dec (StringMid($hMaxColor, 5, 2))
    
    Local $iRndRed = Random($iRed1, $iRed2, 1)
    Local $iRndGreen = Random($iGreen1, $iGreen2, 1)
    Local $iRndBlue = Random($iBlue1, $iBlue2, 1)
    
    Return Dec (Hex($iRndRed, 2) & Hex($iRndGreen, 2) & Hex($iRndBlue, 2))
EndFunc   ;==>RandomColor

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Share this post


Link to post
Share on other sites

#NoTrayIcon
#include <GUIConstants.au3>
#include <Misc.au3>
#Include <GuiListView.au3>
#include <Array.au3>
$nume_program="Fade text SL 1.5.6 -Multicolor-"
Dim $lista_de_culori[15][15],$k,$pune
$Form1 = GUICreate($nume_program, 550, 356, 193, 115)
$lista_culori = GUICtrlCreateListView("Culoare", 464, 12, 73, 205)
_GUICtrlListViewSetColumnWidth($lista_culori,0, 68)
$text_original = GUICtrlCreateEdit( $nume_program & " made by Neagu Ionut (aka SmLex)", 8, 12, 337, 237)
;~ GUICtrlSetData(-1,)
$buton_adauga_culoare = GUICtrlCreateButton("Adauga culoare", 360, 12, 95, 25, 0)
$buton_sterge_culoare = GUICtrlCreateButton("Sterge culoare", 360, 40, 95, 25, 0)
$buton_schimba_culoare = GUICtrlCreateButton("Schimba culoare", 360, 70, 95, 25, 0)
$buton_up = GUICtrlCreateButton("Up", 464, 224, 35, 25, 0)
$buton_down = GUICtrlCreateButton("Down", 504, 224, 35, 25, 0)
$fade_text = GUICtrlCreateInput("", 8, 260, 420, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$buton_clipboard=GUICtrlCreateButton("Pune in Clipboard",435,258,110,26)
$marime = GUICtrlCreateInput("0", 376, 105, 41, 21,BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetTip ($marime,"Pentru resetare scrieti 0.")
$updown=GUICtrlCreateUpdown($marime)
GUICtrlSetLimit($updown,29,6)
$ingrosat = GUICtrlCreateCheckbox("Ingrosat", 364, 140, 73, 17)
$subliniat = GUICtrlCreateCheckbox("Subliniat", 364, 164, 77, 17)
$italic = GUICtrlCreateCheckbox("Italic", 364, 188, 81, 17)
$buton_fade_text = GUICtrlCreateButton("Fade text", 352, 224, 103, 25, 0)
Dim $label[300]
$x=11
$xx=0
For $j=1 to 4
    for $i=1 to 48
        $xx=$xx+1
        $label[$xx]=GUICtrlCreateLabel("",$x*$i,275+$j*15,20,20)
    Next
Next
GUISetState(@SW_SHOW)
$text2=""

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $buton_adauga_culoare
            adauga_culoare()
        Case $buton_sterge_culoare
            sterge_culoare()
        Case $buton_up
            up()
        Case $buton_down
            down()
        Case $buton_fade_text
            $pune=1
            fade()
        Case $buton_clipboard
            ClipPut (GUICtrlRead($fade_text))
        Case $buton_schimba_culoare
            schimba_culoarea()
        Case $subliniat
            fade()
        Case $italic
            fade()
        Case $ingrosat
            fade()
    EndSwitch
;~  If $text2<> GUICtrlRead($text_original) Then 
;~      $text2=GUICtrlRead($text_original)
;~      fade()
;~  EndIf
WEnd




Func schimba_culoarea()
    $nr_de_culori=_GUICtrlListViewGetItemCount($lista_culori)
    $j=0
    $selectat=_GUICtrlListViewGetCurSel($lista_culori)
    If $selectat=-1 Then Return
    $culoare=_ChooseColor(2,_GUICtrlListViewGetItemText($lista_culori,-1),2)
    If (@error)=0 Then
        _GUICtrlListViewSetItemText($lista_culori,$selectat,0,$culoare)
        GUICtrlSetBkColor ($lista_de_culori[$selectat+1][2],$culoare)
        If $nr_de_culori>1 And GUICtrlRead($text_original)<>"" Then
            fade()
        EndIf   
    EndIf
EndFunc


Func adauga_culoare()
    $nr_de_culori=_GUICtrlListViewGetItemCount($lista_culori)
    If $nr_de_culori=10 Then
        MsgBox(0,$nume_program,"Pana acum ati introdus 10 culori, eu cred ca este de ajuns")
        Return
    EndIf
    If $nr_de_culori<>0 Then
        For $i=1 To $nr_de_culori
            $lista_de_culori[$i][1]=_GUICtrlListViewGetItemText($lista_culori,$i-1)
        Next
    EndIf
    
    $nr_de_culori=$nr_de_culori+1
    $lista_de_culori[$nr_de_culori][1]=_ChooseColor(2)
    If (@error)=0 Then
        _GUICtrlListViewDeleteAllItems($lista_culori)
        For $i=1 To $nr_de_culori
            $lista_de_culori[$i][2]=GUICtrlCreateListViewItem ( $lista_de_culori[$i][1],$lista_culori)
            GUICtrlSetBkColor ($lista_de_culori[$i][2],$lista_de_culori[$i][1])
        Next
        _GUICtrlListViewSetItemSelState ($lista_culori,$nr_de_culori-1,1,1)
        If $nr_de_culori>1 And GUICtrlRead($text_original)<>"" Then
            fade()
        EndIf
    EndIf

EndFunc

Func sterge_culoare()
    $nr_de_culori=_GUICtrlListViewGetItemCount($lista_culori)
    $j=0
    $selectat=_GUICtrlListViewGetCurSel($lista_culori)
    If $selectat=-1 Then Return
    If $nr_de_culori<>0 Then
        For $i=0 To $nr_de_culori-1
            If $i<> $selectat Then
                $j=$j+1
                $lista_de_culori[$j][1]=_GUICtrlListViewGetItemText($lista_culori,$i)
            EndIf
        Next
    EndIf
    _GUICtrlListViewDeleteAllItems($lista_culori)
    For $i=1 To $j
        $lista_de_culori[$i][2]=GUICtrlCreateListViewItem ( $lista_de_culori[$i][1],$lista_culori)
        GUICtrlSetBkColor ($lista_de_culori[$i][2],$lista_de_culori[$i][1])
    Next
    If $j>0 Then
        If $j-1<$selectat Then
            _GUICtrlListViewSetItemSelState ($lista_culori,$j-1,1,1)
        Else
            _GUICtrlListViewSetItemSelState ($lista_culori,$selectat,1,1)
        EndIf
    EndIf
    fade()

EndFunc

Func up()
    $nr_de_culori=_GUICtrlListViewGetItemCount($lista_culori)
    $selectat=_GUICtrlListViewGetCurSel($lista_culori)
    If $selectat=-1 Then Return
    If $selectat=0 then Return
    If $nr_de_culori<>0 Then
        For $i=0 To $nr_de_culori-1
            $lista_de_culori[$i+1][1]=_GUICtrlListViewGetItemText($lista_culori,$i)
        Next
    Else
        Return
    EndIf
    $aux=$lista_de_culori[$selectat][1]
    $lista_de_culori[$selectat][1]=$lista_de_culori[$selectat+1][1]
    $lista_de_culori[$selectat+1][1]=$aux
    _GUICtrlListViewDeleteAllItems($lista_culori)
    For $i=1 To $nr_de_culori
        $lista_de_culori[$i][2]=GUICtrlCreateListViewItem ( $lista_de_culori[$i][1],$lista_culori)
        GUICtrlSetBkColor ($lista_de_culori[$i][2],$lista_de_culori[$i][1])
    Next
    _GUICtrlListViewSetItemSelState ($lista_culori,$selectat-1,1,1)
    If $nr_de_culori>1 And GUICtrlRead($text_original)<>"" Then
        fade()
    EndIf
EndFunc

Func down()
    $nr_de_culori=_GUICtrlListViewGetItemCount($lista_culori)
    $selectat=_GUICtrlListViewGetCurSel($lista_culori)
    If $selectat=-1 Then Return
    If $selectat=$nr_de_culori-1 then Return
    If $nr_de_culori<>0 Then
        For $i=0 To $nr_de_culori-1
            $lista_de_culori[$i+1][1]=_GUICtrlListViewGetItemText($lista_culori,$i)
        Next
    Else
        Return
    EndIf
    $aux=$lista_de_culori[$selectat+2][1]
    $lista_de_culori[$selectat+2][1]=$lista_de_culori[$selectat+1][1]
    $lista_de_culori[$selectat+1][1]=$aux
    _GUICtrlListViewDeleteAllItems($lista_culori)
    For $i=1 To $nr_de_culori
        $lista_de_culori[$i][2]=GUICtrlCreateListViewItem ( $lista_de_culori[$i][1],$lista_culori)
        GUICtrlSetBkColor ($lista_de_culori[$i][2],$lista_de_culori[$i][1])
    Next
    _GUICtrlListViewSetItemSelState ($lista_culori,$selectat+1,1,1)
    If $nr_de_culori>1 And GUICtrlRead($text_original)<>"" Then
        fade()
    EndIf
EndFunc


Func fade()
    $litere=StringSplit(GUICtrlRead($text_original),"")
    If $litere[0]=0 Then
        GUICtrlSetData($fade_text,"")
        For $i=1 to 192
            GUICtrlSetData($label[$i],"")
        Next
        If $pune=1 Then 
            MsgBox(16,$nume_program,"Nu ati introdus nici un text")
            $pune=0
        EndIf
        Return
    EndIf
    $nr_de_culori=_GUICtrlListViewGetItemCount($lista_culori)
    If $nr_de_culori<2 Then
        GUICtrlSetData($fade_text,"")
        For $i=1 to 192
            GUICtrlSetData($label[$i],"")
        Next
        If $pune=1 Then 
            MsgBox(16,$nume_program,"Nu ati ales cel putin doua culori")
            $pune=0
        EndIf
        Return
    EndIf
    For $i=1 to 192
        GUICtrlSetData($label[$i],"")
    Next
    $k=0
    $nr_de_caractere=$litere[0] / ($nr_de_culori-1)
    For $i=1 to $nr_de_culori-1
        $text=""
        For $j= Round($nr_de_caractere*($i-1)+1) To Round($nr_de_caractere*$i)
            $text=$text & $litere[$j]
        Next
        If $i=1 Then
            $textul_cu_fade="[color=#" & StringTrimLeft(_GUICtrlListViewGetItemText($lista_culori,0),2) & "]" & StringLeft($text,1)& "[/color]"
            $k=1
            GUICtrlSetData($label[1],$litere[1])
            GUICtrlSetColor ( $label[$i],_GUICtrlListViewGetItemText($lista_culori,0))
            
;~          **********
            $proprietati=0
;~          If GUICtrlRead($ingrosat)= $GUI_CHECKED Then $proprietati=$proprietati+8
            If GUICtrlRead($italic)= $GUI_CHECKED Then $proprietati=$proprietati+2
            If GUICtrlRead($subliniat)= $GUI_CHECKED Then $proprietati=$proprietati+4
            GUICtrlSetFont ($label[$i],9,400,$proprietati )
;~ **************
            $textul_cu_fade=$textul_cu_fade & fade_text(StringTrimLeft($text,1),_GUICtrlListViewGetItemText($lista_culori,0),_GUICtrlListViewGetItemText($lista_culori,1))
        Else
            $textul_cu_fade = $textul_cu_fade & fade_text($text,_GUICtrlListViewGetItemText($lista_culori,$i-1),_GUICtrlListViewGetItemText($lista_culori,$i))
        EndIf
    Next
    
    If GUICtrlRead($marime)<>0 Then
        $textul_cu_fade="[size=" & GUICtrlRead($marime) & "]" & $textul_cu_fade & "[/size]"
    EndIf
    If GUICtrlRead($ingrosat)= $GUI_CHECKED Then
        $textul_cu_fade="[b]" & $textul_cu_fade & "[/b]"
    EndIf
    
    If GUICtrlRead($italic)= $GUI_CHECKED Then
        $textul_cu_fade="[i]" & $textul_cu_fade & "[/i]"
    EndIf
    
    If GUICtrlRead($subliniat)= $GUI_CHECKED Then
        $textul_cu_fade="[u]" & $textul_cu_fade & "[/u]"
    EndIf
    
    If $pune=1 Then
        ClipPut ($textul_cu_fade)
        $pune=0
    EndIf
    GUICtrlSetData($fade_text,$textul_cu_fade)
EndFunc


Func fade_text($text,$culoarea1,$culoarea2)
    Dim $cul1[4],$cul2[4],$diferenta[4][4],$text_rezultat
    
    $culoarea=StringTrimLeft($culoarea1,2)
    $cul1[1]=Dec(StringLeft($culoarea,2))
    $culoarea=StringTrimLeft($culoarea,2)
    $cul1[2]=Dec(StringLeft($culoarea,2))
    $cul1[3]=Dec(StringTrimLeft($culoarea,2))
    $culoarea=StringTrimLeft($culoarea2,2)
    $cul2[1]=Dec(StringLeft($culoarea,2))
    $culoarea=StringTrimLeft($culoarea,2)
    $cul2[2]=Dec(StringLeft($culoarea,2))
    $cul2[3]=Dec(StringTrimLeft($culoarea,2))
    $litere=StringSplit($text,"")
    
    If $cul1[1]>$cul2[1] Then
        $diferenta[1][2]=-1
        $diferenta[1][1]=($cul1[1]-$cul2[1]) / $litere[0]
    Else
        $diferenta[1][2]=1
        $diferenta[1][1]=($cul2[1]-$cul1[1])/ $litere[0]
    EndIf
    
    If $cul1[2]>$cul2[2] Then
        $diferenta[2][2]=-1
        $diferenta[2][1]=($cul1[2]-$cul2[2])/ $litere[0]
    Else
        $diferenta[2][2]=1
        $diferenta[2][1]=($cul2[2]-$cul1[2])/ $litere[0]
    EndIf
    
    If $cul1[3]>$cul2[3] Then
        $diferenta[3][2]=-1
        $diferenta[3][1]=($cul1[3]-$cul2[3])/ $litere[0]
    Else
        $diferenta[3][2]=1
        $diferenta[3][1]=($cul2[3]-$cul1[3])/ $litere[0]
    EndIf
    $x=10
    
    
    For $i=1 to $litere[0]
        $cul1[1]=$cul1[1]+($diferenta[1][1]*$diferenta[1][2])
        $cul1[2]=$cul1[2]+($diferenta[2][1]*$diferenta[2][2])
        $cul1[3]=$cul1[3]+($diferenta[3][1]*$diferenta[3][2])
        
        $c1=Hex(Round($cul1[1]),2)
        $c2=Hex(Round($cul1[2]),2)
        $c3=Hex(Round($cul1[3]),2)
        
        $k=$k+1
        If $k<192 Then
            GUICtrlSetData($label[$k],$litere[$i])
            $culoarea_="0x"& $c1 & $c2 & $c3
            GUICtrlSetColor ( $label[$k],$culoarea_)
            $proprietati=0
            If GUICtrlRead($italic)= $GUI_CHECKED Then $proprietati=$proprietati+2
            If GUICtrlRead($subliniat)= $GUI_CHECKED Then $proprietati=$proprietati+4
            GUICtrlSetFont ($label[$k],9,400,$proprietati )
        EndIf
        $text_rezultat=$text_rezultat & "[color=#"& $c1 & $c2 & $c3 &"]" & $litere[$i] & "[/color]"
        
        $text_rezultat=StringReplace($text_rezultat,">",">")
        $text_rezultat=StringReplace($text_rezultat,"<","<")
    Next
    Return $text_rezultat
EndFunc

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Little script to make cone graphics. (i don't know if that's the right word in english.)

Indeed it is, very nice!

(code)

That is your first post!?!? Holy Crap! Makes anything i've done look... silly (granted they are, but still :whistle: ).

Now I just need to translate it, took me a bit to figure that out ;)

edit: CoePSX, didn't you write a text fader too? I thought I recall it being much shorter...

Edited by fisofo

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