Popular Post UEZ Posted January 5, 2009 Popular Post Share Posted January 5, 2009 (edited) Here some useless graphical examples using GDI+, made for fun (my 1st GDI+ codes ): !Some examples may run slowly on WinXP machines (workaround in this thread)! Some examples using Hex() function need adjustment when running on AutoIt version 3.3.8.0+ otherwise colors are flashing (fixed versions in AiO package below)!!! #01 Flying Pearl Necklaces: Source code here (577 downloads previously)! Flying Pearl Necklaces.au3 #02 Flying Squares: Source code here (265 downloads previously)! Flying Squares.au3 #03 Rotating Squares: Source code here! Rotating_Squares.au3 #04 Plasma & Plasma Variant: Source codes here! Plasma: Plasma.au3 Plasma Variant: Plasma Variante.au3 #05 L-System Fractals: Source code here (382 downloads previously)! L-System Fractals.7z #06 Sinus Scroller: Source code here (218 downloads previously)! Sinus Scroller.au3 #07 Visualization: Analog Meter: download here (including source, needed files and compiled exe): Source code + needed files here (473 downloads previously)! Visualizer_Analog Meter.7z More GDI+ visualizations here by monoceres or by Eukalyptus Audio Visualization Collection (German site) #08 Particle Catapult: Source code here (70 downloads previously)! Particle_Catapult.au3 #09 Rotating Cube: Source code here (79 downloads previously)! Rotating_Cube.au3 #10 Simple Ball Collision Simulation: Source code here (35 downloads previously)! Simple_Ball_Collision_Simulation.au3 (it is not finished yet! look from time to time into this thread for an update! Nice tutorial here) #11 Particle Explosions: Source code here: Explosions__from_AutoIteroids_.au3 #12 Rotating Letters: Source codes here: Rotating Letters.au3 Transparent version (87 downloads previously): Rotating Letters Transparent.au3 #13 Rotating Cube 2: Source code here (53 downloads previously): Rotating Cube 2.au3 #14 Rotating Cube 2 with Textures: Source code here (68 downloads previously): Rotating Cube 2 + Textures.7z #15 Rotating Cube 2 with some examples from above on each surface: Source code here (55 downloads previously): Rotating Cube 2 + animated surfaces.7z #16 Rotating Cube 2 simple: Source code here: Rotating Cube 2 - Simple.au3 Or with background pic or Rotating Cube 2 simple + Background #17 Tramp of Particles: Source code here: Tramp of Particles.au3 #18 Twister: Source code here: Twister.au3 WinAPI version is 2.5x faster (look in AiO archive)! #19 Star Burst: Source code here: Star Burst.au3 #20 Warp Starfield: Source code here: Warp Starfield.au3 #21 Plasma 2: Source code here: Plasma 2.au3 #22 Isometric Level-3 Cube: Source code here: Isometric Level-3 Cube.au3 #23 Zoomer: Source code here (7 downloads previously): Zoomer.au3 GDIP.au3 needed for Zoomer! #24 Suspended Cloth Simulation: Source code here: Suspended Cloth Simulation.au3 #25 Visualizer: Oscilloscope Farbrausch: Source code here (30 downloads previously): Visualizer Oscilloscope Farbrausch.au3 To run Visualizer Oscilloscope Farbrausch.au3 properly you need following files: Bass.au3, BassExt.au3, Bass.dll and BassExt.dll. These files can be found in AiO package or on German AutoIt site! #26 Im- Exploding Particle Logo: Source code here: Im- Exploding Particle Logo.7z #27 Pixel Text Effect: Source code here (12 downloads previously): Pixel Text Effect.7z or with ♬chip sound♫ aka demo style (download from German AutoIt site or from AiO archive). #27 works best on Vista+ machines! #28 Star Wars Scroller: Source code here: Star Wars Scroller.au3 For a complete Star Wars Intro have a look to eukalyptus' Star-Wars Intro (see below!) #29 Rotated Letters Simple: Source code here: Rotated Letters Simple.au3 #30 Ballet of Letters: Source code here: Ballet of Letters.au3 #31 Perfect Illusion: Source code here: Perfect Illusion Variant 1.au3 Perfect Illusion Variant 2.au3 Perfect Illusion Variant 3.au3 Mesmerizing Squares Screensaver (previous downloads approx. 100): Mesmerizing_Squares_Screensaver.au3 (compiled version here): Don't stare too long on it or you will be mesmerized One more: Rotating triangle + vertical scroller + music (modification of monoceres' code): Magic Lines Screesaver (110 downloads previously): Magic Lines Screensaver.7z Another screensaver - 3D Star Scrolling Screensaver (83 downloads previously): GDI+ 3D Star Scrolling Screensaver.au3 !Some examples may run slowly on WinXP machines (workaround in this thread)! Some examples using Hex() function need adjustment when running on AutoIt version 3.3.8.0+ otherwise colors are flashing (fixed versions in AiO package below)!!! AiO download link ☞ AiO1 or AiO2 ☜ (all examples above compiled + source codes packed with 7-Zip) Have a look also to the game I made using GDI+: Link: AUTOITEROIDS v1.018 Build 2011-06-09 (Final) (a clone of the game Asteroids made by Atari 1979) I hope you like it! Any kind of comment is welcome!!! My examples are all done with AutoIt v3.3.0.0 on Vista x32! Kudos to: monoceres, smashly, malkey, Eukalyptus and Authenticity! Check out Some Graphical Examples using GDI+ Vol. II build 2016-01-25 More examples made by other members in this thread (thanks you very much!): Spinning Flying Pearl Necklaces by smashly: Spinning Flying Squares by smashly and ProgAndy LMP Visualization by youknowwho4eva: SineWorm by monoceres: Enterprise Warp by youknowwho4eva: Confused ASCII by monoceres: Lissajous Curve by monoceres: Butterfly Curve by monoceres: ParticleCollisionFun2 by crashdemons: Extreme nice physic engine by moritz1243 (German site): Lingering Line by MvGulik: Scroller Sine Blobs by Lakes: Cube surface and 3D axis and by Lakes: by eukalyptus: by eukalyptus: Two more examples by eukalyptus: and FEEL FREE TO POST YOUR GDI+ EXAMPLES HERE,TOO!!! Have fun and regards, UEZ ✌ PS: more modified examples also here in this topic History of my useless scripts above: Spoiler 2009-01-06: code modified (#01 Flying Pearl Necklaces -> if $i > 4700 then $i = -650 for looping! 2009-01-08: moved 2nd example to 1st post (#02 Flying Squares) 2009-01-09: added _GDIPlus_BrushDispose() and _GDIPlus_PenDispose() to both examples to Do / Until loop (thanx smashly) 2009-01-11: changed topic and added 2 more GDI+ examples (#03 Rotating Squares and #04 Plasma) 2009-01-12: moved _GDIPlus_BrushDispose($Brush) inside the loop to avoid memory hog. Thanks again smashly. 2009-01-15: added GDI+ example Dragon Curve 2009-01-16: 1000x thanks to smashly for correcting my GDI+ "nonsenses" everytime 2009-01-17: changed Dragon Curve code to #05 L-System Fractals -> added 3 more code examples based on same system 2009-01-18: refreshed some coding parts by new values 2009-01-22: added Mesmerizing Squares Screensaver (thanks to james3mg, SmOke_N and erifash for help / sub routines) 2009-01-23: fixed multi monitor feature problem in Mesmerizing Squares Screensaver code 2009-01-23: changed draw order from back to front in #02 Flying Squares to give true perspective (old drawed from front to back) 2009-01-30: added #06 Sinus Scroller example 2009-02-01: #01 Flying Pearl Necklaces code modified (added color for each ball) 2009-02-03: #04 Plasma code modifed (added _GDIPlus_BrushSetSolidColor() instead of using _GDIPlus_BrushCreateSolid() in the loop -> thanks smashly) 2009-02-05: added Triangle and Arrowhead to #05 L-System Fractals (6 modules implemented currently) 2009-02-06: added Sierpinski Triangle, Gosper Curve, Sierpinski Carpet and Penta Plexity to #05 L-System Fractals 2009-02-07: added Pythagoras Tree to #05 L-System Fractals (11 modules implemented currently) 2009-02-08: added a simple 2D star scroller to #06 Sinus Scroller example 2009-02-09: changed color design in #05 L-System Fractals; made same mistake again that smashly told me again and again in #06 Sinus Scroller -> fixed 2009-02-15: changed background to white in #01 Flying Pearl Necklaces - looks better 2009-02-18: increased the draw speed in Mesmerizing Squares Screensaver (up to 15,29% on my notebook. Screen resolution is 1920x2224 on dual monitor) 2009-03-09: added 07# GDI+ Visualization: Analog Meter Beta 2009-03-11: Beta phase ended for 07# GDI+ Visualization: Analog Meter! Now final. Code and downloads updated 2009-03-17: Updated 07# GDI+ Visualization: Analog Meter. Now level amplitude depends on master volume -> louder = higher level amplitude 2009-03-20: Fixed 07# GDI+ Visualization: Analog Meter bug -> bass.dll returns negative values for channel levels 2009-03-21: added some features to #07 GDI+ Visualization: Analog Meter -> now you use o,p and c keys to open, pause and continue song 2009-03-22: found another issue with bass.dll -> always returns 1 on _BASS_GetVolume() function on my desktop pc -> code / download updated 2009-03-23: added another small GDI+ example: #08 Particle Catapult 2009-03-24: redesigned 1st post 2009-03-25: changed some codes in #08 Particle Catapult -> you can use now your lmb and mouse wheel to influence particles (confetti) 2009-03-26: changed needle position in #07 GDI+ Visualization: Analog Meter -> now needle root is under the "thing in the middle" 2009-04-01: added drag 'n' drop feature in #07 GDI+ Visualization: Analog Meter for better file handling (only 1 file will played if your drag 'n' drop more than one)! 2009-04-05: added one more GDI+ example: #09 Rotating Cube 2009-04-06: change design in #09 Rotating Cube -> now looks better (i.m.o) 2009-04-07: found a bug in #07 GDI+ Visualization: Analog Meter: needle freezes in "get volume error" mode when P was pressed instead of slowly moving to the left 2009-04-08: change design again in #09 Rotating Cube -> now it looks still another stage better (i.m.o) 2009-04-13: added #10 Simple Ball Collision Simulation beta example. It is still in beta phase. 2009-04-21: made some minor changes to #10 Simple Ball Collision Simulation beta example -> now "orbiting" shouldn't be available anymore. Changed friction slider to 0 - 100. Mouse control over balls still in progress! 2009-04-27: made some minor changes to #09 Rotating Cube (changed size and colors) and #08 Particle Catapult (implemented z axis look of particles)! 2009-04-28: tried to give balls in #09 Rotating Cube a 3D look 2009-06-03: added z axis to the letters in #06 Sinus Scroller 2009-06-29: added #11 Particle Explosions (modified code from AUTOITEROIDS) 2009-10-18: speed up #05 L-System Fractals! Now drawing is a little bit faster! Working on Fractal Plant implementation! 2009-10-23: added #12 Rotating Letters! One more useless GDI+ script! 2009-11-03: added transparent version of #12 Rotating Letters! 2009-11-11: added Magic Lines Screensaver because I never published it in its own thread (my 1st steps in GDI+!). Maybe you like it 2009-11-14: made some modifications to #06 Sinus Scroller. Now less CPU usage but still I'm not really happy with it at all... 2009-11-25: added save feature in #05 L-System Fractals! Now you can save image (standard output format is png) anytime by pressing F9. 2010-03-10: added #13 Rotating Cube 2! Simple cube rotation using basic code from #09 Rotating Cube 2010-03-12: added #14 Rotating Cube 2 with build-in textures! Thanks to Malkey for the tip how to handle surfaces 2010-03-14: added #15 Rotating Cube 2 with 6 GDI+ examples from me on the surfaces! 2010-03-15: made small modifications to #13, #14 and #15! 2010-03-24: added brightness effect to the surfaces in #14 Rotating Cube 2 with build-in textures! The surfaces get darker when they are rotating to the back! Thanks to Authenticity for the GDIp.au3 and the examples! 2010-04-07: added #16 Rotating Cube 2 simple! A simple cube. The perspective of example #14 and #15 is not correct because _GDIPlus_DrawImagePoints() can draw only a parallelogram! Maybe I will find another way... 2010-04-18: compressed several au3 codes and images to save attachment space 2010-08-22: added #17 Tramp of Particles, #18 Twister, #19 Star Burst and #20 Warp Starfield -> Twister is too slow for pure AutoIt - it screams for an inline ASM solution 2010-08-28: added 2 more examples: #21 Plasma 2 and #22 Isometric Level-3 Cube 2010-08-31: added #23 Zoomer (imho a very cool effect) 2010-09-04: one more -> #24 Suspended Cloth Simulation. Use lmb to move right bottom of cloth, F5 to restart and F6 to turn on/off gravity 2010-09-07: Inspired by Zoomer I created #25 Visualizer: Oscilloscope Farbrausch, the next GDI+ example! To run Visualizer Oscilloscope Farbrausch.au3 properly you need following files: Bass.au3, BassExt.au3, Bass.dll and BassExt.dll. These files can be found in AiO package! Thanks to eukalyptus for the files! 2010-09-21: the next example on the way: #26 Im- Exploding Particle Logo. Also nice effekt 2010-09-30: added this time #27 Pixel Text Effect which is currently in beta phase 2010-10-07: added to #27 Pixel Text Effect a few effects e.g. morphing 2010-10-15: forgot to upload the small changes I made in #25 Visualizer: Oscilloscope Farbrausch 2010-10-17: small modifications to #27 Pixel Text Effect -> now with chip sound - demo style. Available only in AiO package or from German AutoIt site because of low attachment space here. 2010-10-21: some more small modifications to #27 Pixel Text Effect 2011-03-28: #28 example added: my version of Star Wars scroller ;-) 2011-04-06: #29 Rotated Letters Simple added - inspired by this thread: 2011-04-08: #30 Ballet of Letters is a further development of #29 Rotated Letters Simple 2011-06-02: #31 Perfect Illusion with 3 variants. Thanks to Ximorro for the idea 2011-06-26: added another screensaver code -> 3D Star Scrolling Screensaver 2012-02-10: fixed a bug in GDI+ 3D Star Scrolling Screensaver (preview screen) Edited January 27, 2016 by UEZ Changed topic name (Some Graphical Examples Using GDI+) Muhammad_Awais_Sharif, Alenis, jaberwacky and 5 others 7 1 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...
monoceres Posted January 6, 2009 Share Posted January 6, 2009 Hypnotizing... found myself just starring on it for a few minutes (after changing the sleep to 20 ms, went smoother) Good job Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
UEZ Posted January 6, 2009 Author Share Posted January 6, 2009 @monoceres: thanks for feedback -> changed it to sleep(20)Apropos sleep - it's a good idea now -> Goto Sleep(6h) 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...
Josbe Posted January 6, 2009 Share Posted January 6, 2009 Nice effect. Playing with transparency gives an interesting variation too: expandcollapse popup;coded by UEZ 2008-01-06 #include <GuiConstantsEx.au3> #include <GDIPlus.au3> Opt('MustDeclareVars', 1) Global Const $Pi = 3.1415926535897932384626 Global Const $width = 400 Global Const $height = 400 Global $hGUI, $hWnd, $Graphic, $ParticleBitmap, $ParticleBuffer, $Brush1, $Brush2 Global $starting_point, $i, $j, $k, $xcoord1, $ycoord1, $xcoord2, $ycoord2, $size, $red, $green, $blue, $trans1, $trans2 ; Create GUI $hGUI = GUICreate("GDI+: Flying Pearl Necklace by UEZ 2009", $width, $height) $hWnd = WinGetHandle($hGUI) GUISetState() _GDIPlus_Startup () $Graphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd) ;create graphic $ParticleBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $Graphic) ;create bitmap $ParticleBuffer = _GDIPlus_ImageGetGraphicsContext($ParticleBitmap) ;create buffer AntiAlias($ParticleBuffer, 4) _GDIPlus_GraphicsClear($ParticleBuffer) ;clear buffer $i = -600 $starting_point = 0 ; Loop until user exits Do $red = ((Sin(2^0 * $i / 2^5) + 1) / 2) * 256 $green = ((Cos(2^0 * $i / 2^7) + 1) / 2) * 256 $blue = ((-ATan(2^0 * $i / 2^9) + 1) / 2) * 256 $trans1 = Hex(Random(50, 95), 2) $trans2 = Hex(Random(50, 95), 2) $Brush1 = _GDIPlus_BrushCreateSolid("0x" & $trans1 & Hex($red, 2) & Hex($green, 2) & Hex($blue, 2)) $Brush2 = _GDIPlus_BrushCreateSolid("0x" & $trans2 & Hex($blue, 2) & Hex($red, 2) & Hex($green, 2)) _GDIPlus_GraphicsClear($ParticleBuffer) ;clear buffer $k = 2^12 $starting_point -= 0.05 For $j = 1 To $k Step 32 $size = $i - $j $xcoord1 = $width / 2 - (($i - $j) / 2) + Sin($starting_point) * -Sin(($i - $j) * $Pi / 90) * 64 $ycoord1 = $height / 2 - (($i - $j) / 2) + -Cos($starting_point) * Cos(($i - $j) * $Pi / 90) * 32 _GDIPlus_GraphicsFillEllipse($ParticleBuffer, $xcoord1, $ycoord1, $size / 6 , $size / 6, $Brush1) $xcoord2 = $width / 2 - (-($i - $j) / -1.75) - Sin($starting_point) * Sin(($i - $j) * $Pi / 120) * 32 $ycoord2 = $height / 2 - (($i - $j) / -1.75) - Cos($starting_point) * Cos(($i - $j) * $Pi / 75) * 16 _GDIPlus_GraphicsFillEllipse($ParticleBuffer, $xcoord2, $ycoord2, $size / 8 , $size / 8, $Brush2) Next _GDIPlus_GraphicsDrawImageRect($Graphic, $ParticleBitmap, 0, 0, $width, $height) ;copy to bitmap $i += 3 Sleep(20) Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Clean up resources _GDIPlus_GraphicsDispose ($Graphic) _GDIPlus_BitmapDispose($ParticleBitmap) _GDIPlus_GraphicsDispose($ParticleBuffer) _GDIPlus_BrushDispose($Brush1) _GDIPlus_BrushDispose($Brush2) _GDIPlus_Shutdown () Func AntiAlias($Graphics, $iMode) Local $aResult $aResult = DllCall($ghGDIPDll, "int", "GdipSetSmoothingMode", "hwnd", $Graphics, "int", $iMode) If @error Then Return SetError(@error, @extended, False) Return SetError($aResult[0], 0, $aResult[0] = 0) EndFunc ;==>_AntiAlias AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
gseller Posted January 6, 2009 Share Posted January 6, 2009 Fasinating! Link to comment Share on other sites More sharing options...
Achilles Posted January 6, 2009 Share Posted January 6, 2009 Wow, that is pretty sweet... I didn't know autoit could do stuff that graphically orientated.. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
UEZ Posted January 6, 2009 Author Share Posted January 6, 2009 Thanks for your feedback! 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...
youknowwho4eva Posted January 6, 2009 Share Posted January 6, 2009 Wow I really need to start learnin GDI+. I'm wondering, is there a way for this to run in the background and export the image as a jpeg? Giggity Link to comment Share on other sites More sharing options...
Josbe Posted January 6, 2009 Share Posted January 6, 2009 (edited) Wow I really need to start learnin GDI+. I'm wondering, is there a way for this to run in the background and export the image as a jpeg?Yes. You can search examples in the forum like the captcha (can't remember the author). Edited January 7, 2009 by Josbe AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
trancexx Posted January 6, 2009 Share Posted January 6, 2009 I don't know why Barbarella is in my head when looking this. And Jane Fonda. Very nice! ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
monoceres Posted January 6, 2009 Share Posted January 6, 2009 Wow I really need to start learnin GDI+. I'm wondering, is there a way for this to run in the background and export the image as a jpeg?Yes and very easy too.Since UEZ is double buffering the with a standard bitmap you can replace the following line:_GDIPlus_GraphicsDrawImageRect($Graphic, $ParticleBitmap, 0, 0, $width, $height) ;copy to bitmapwith:_GDIPlus_ImageSaveToFile($ParticleBitmap,@ScriptDir&"\"&$LoopCount&".jpg"where $LoopCount is an integer that you increment every loop. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
UEZ Posted January 7, 2009 Author Share Posted January 7, 2009 (edited) I don't know why Barbarella is in my head when looking this. And Jane Fonda.Very nice!Strange fantasy LOL UEZ Edited January 7, 2009 by 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 January 8, 2009 Author Share Posted January 8, 2009 (edited) Here a modification (Flying Squares):Look to my 1st post!UEZ Edited January 8, 2009 by 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...
L3G3NdKillEr Posted January 8, 2009 Share Posted January 8, 2009 Wow Its Fantastic... i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================> Link to comment Share on other sites More sharing options...
youknowwho4eva Posted January 8, 2009 Share Posted January 8, 2009 (edited) I still need to play with the gdi+. But I changed up your square one a little. It's kinda hypnotizing. expandcollapse popup;coded by UEZ 2008-01-08 #include <GuiConstantsEx.au3> #include <GDIPlus.au3> Opt('MustDeclareVars', 1) Global Const $Pi = 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706 7982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381 9644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412 7372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160 9433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949 1298336733624406566430 Global Const $width = 600 Global Const $height = 600 Global $hGUI, $hWnd, $hGraphic, $ParticleBitmap, $ParticleBuffer, $hBrush0, $hBrush1, $hBrush2, $Pen, $real Global $starting_point, $i, $j, $k, $xcoord1, $ycoord1, $xcoord2, $ycoord2, $size, $red, $green, $blue, $start, $ran ; Create GUI $hGUI = GUICreate("GDI+: Flying Squares by UEZ 2009", $width, $height) $hWnd = WinGetHandle($hGUI) GUISetState() ; Draw an ellipse _GDIPlus_Startup () $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd);create graphic $ParticleBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic);create bitmap $ParticleBuffer = _GDIPlus_ImageGetGraphicsContext($ParticleBitmap);create buffer $hBrush1 = _GDIPlus_BrushCreateSolid(0x7F777777) AntiAlias($ParticleBuffer, 4) _GDIPlus_GraphicsClear($ParticleBuffer);clear buffer $real = 6 $start = -12 $i = $start $starting_point = 0 ; Loop until user exits Do $red = ((Sin(2^0 * $i / 2^5) + 1) / 2) * 256 $green = ((Sin(2^0 * $i / 2^7) + 1) / 2) * 256 $blue = ((Sin(2^0 * $i / 2^9) + 1) / 2) * 256 $hBrush1 = _GDIPlus_BrushCreateSolid("0x0F" & Hex($red, 2) & Hex($green, 2) & Hex($blue, 2)) $Pen = _GDIPlus_PenCreate("0xEF" & Hex($red, 2) & Hex($green, 2) & Hex($blue, 2), 1) _GDIPlus_GraphicsClear($ParticleBuffer);clear buffer $k = 2^12 $starting_point -= 0.05 For $j = 1 To $k Step $real ;~ $ran = Random (1,2,1) $real += 1 If $real = 20 Then $real = 6 $size = $i - $j $xcoord1 = $width / 2 - (($i - $j) / 2) + cos($starting_point) * -Sin(($i - $j) * $Pi / 90) * 64 $ycoord1 = $height / 2 - (($i - $j) / 2) + -Sin($starting_point) * cos(($i - $j) * $Pi / 90) * 32 $xcoord2 = $width / 2 - (-($i - $j) / 2) + cos($starting_point) * -Sin(($i - $j) * $Pi / 90) * 64 $ycoord2 = $height / 2 - (($i - $j) / 2) + -Sin($starting_point) * cos(($i - $j) * $Pi / 90) * 32 _GDIPlus_GraphicsDrawRect($ParticleBuffer, $xcoord1, $ycoord1, $size, $size, $Pen) ;~ _GDIPlus_GraphicsFillRect($ParticleBuffer, $xcoord1, $ycoord1, $size, $size, $hBrush1) Next _GDIPlus_GraphicsDrawImageRect($hGraphic, $ParticleBitmap, 0, 0, $width, $height);copy to bitmap $i += 2 If $i > $k + 2^12 Then $i = $start Sleep(20) Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Clean up resources _GDIPlus_GraphicsDispose ($hGraphic) _GDIPlus_BitmapDispose($ParticleBitmap) _GDIPlus_GraphicsDispose($ParticleBuffer) _GDIPlus_BrushDispose($hBrush1) _GDIPlus_Shutdown () Func AntiAlias($hGraphics, $iMode) Local $aResult $aResult = DllCall($ghGDIPDll, "int", "GdipSetSmoothingMode", "hwnd", $hGraphics, "int", $iMode) If @error Then Return SetError(@error, @extended, False) Return SetError($aResult[0], 0, $aResult[0] = 0) EndFunc ;==>_AntiAlias Edit: I added some digits to pi as well :-P doesn't make a difference. Edited January 8, 2009 by youknowwho4eva Giggity Link to comment Share on other sites More sharing options...
sandin Posted January 8, 2009 Share Posted January 8, 2009 looks like a good base for building a "3D" game (the squares script) great work btw! Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
youknowwho4eva Posted January 8, 2009 Share Posted January 8, 2009 (edited) Naw, this is a start to a possible 3D game. I need to do more with that. I've been slacking lately. http://www.autoitscript.com/forum/index.ph...;hl=au3irrlichtEdit, the reason I was asking about exporting the image was possibly adding that to my 3D work, having a spinning cube with the pearl necklace on it, that would be nifty. Edited January 8, 2009 by youknowwho4eva Giggity Link to comment Share on other sites More sharing options...
UEZ Posted January 8, 2009 Author Share Posted January 8, 2009 Naw, this is a start to a possible 3D game. I need to do more with that. I've been slacking lately. http://www.autoitscript.com/forum/index.ph...;hl=au3irrlichtIn my opinion the problem is not GDI+ but the mathematics to realize 3D I'm just a beginner, too.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 January 8, 2009 Author Share Posted January 8, 2009 looks like a good base for building a "3D" game (the squares script) great work btw! Thanks for your comment 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...
youknowwho4eva Posted January 8, 2009 Share Posted January 8, 2009 I'm an engineer, so 3D is my thing. Scripting not so much so. Requires to much organization. I don't know too many organized engineers. I haven't done anything with GDI+ so I have no idea of its 3D potentials. Visually it is amazing though. Giggity 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