Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <GDIP.au3>
- ; - Author: name22 (www.autoit.de)
- $hWnd = GUICreate("Example by name22", 400, 200)
- $hWnd_Seed = GUICreate("Random Seed", 200, 60)
- $cInput_Seed = GUICtrlCreateInput("Seed", 5, 5, 190, 20)
- $cButton_Generate = GUICtrlCreateButton("Generate", 5, 30, 60, 25)
- $cButton_Go = GUICtrlCreateButton("Go", 70, 30, 60, 25)
- GUISetState(@SW_SHOW, $hWnd_Seed)
- While True
- Switch GUIGetMsg()
- Case -3
- Exit
- Case $cButton_Generate
- $iSeed = Random(0, 2 ^ 31 - 1, 1) * -1 ^ Random(1, 2, 1)
- GUICtrlSetData($cInput_Seed, $iSeed)
- Case $cButton_Go
- $iSeed = GUICtrlRead($cInput_Seed)
- If Int($iSeed) Or $iSeed = 0 And $iSeed >= -2 ^ 31 And $iSeed < 2 ^ 31 Then ExitLoop
- EndSwitch
- WEnd
- GUIDelete($hWnd_Seed)
- SRandom($iSeed)
- $iARGB_Start = "0xFF" & Hex(Round(Random() * 0xFFFFFF), 6)
- $iARGB_End = "0xFF" & Hex(Round(Random() * 0xFFFFFF), 6)
- GUISetState(@SW_SHOW, $hWnd)
- _GDIPlus_Startup()
- $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
- _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2)
- _GDIPlus_GraphicsClear($hGraphics, 0xFFFFFFFF)
- $hBrush = _GDIPlus_LineBrushCreate(0, 0, 400, 0, $iARGB_Start, $iARGB_End)
- _GDIPlus_GraphicsFillRect($hGraphics, 0, 0, 400, 200, $hBrush)
- _GDIPlus_GraphicsDispose($hGraphics)
- _GDIPlus_BrushDispose($hBrush)
- _GDIPlus_Shutdown()
- While GUIGetMsg() <> -3
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment