Vindicator209 Posted August 7, 2008 Share Posted August 7, 2008 How do you invert RGB hex codes? I can't do it one by one because it's going to be on a massive scale (like 10000) Theres probably something right in my face but I'm not thinking too well at 1am. Thanks [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 7, 2008 Moderators Share Posted August 7, 2008 http://www.vb-helper.com/howto_invert_color.htmlSame concept I'm sure. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Vindicator209 Posted August 7, 2008 Author Share Posted August 7, 2008 (edited) I understand the subtracting the RGB colors, which is much easier so I'll just change my cript to us that instead of hex... but down below it says to multiply r by 255.... I didn't know you could multiply numbers by letters, but I'll look into it tomorrow, thanks EDIT: haha, what am I thinking... RGB isin't a color mode in autoit..... so I guess that means I'm stuck back at square one... anyway, I'll get back to it after I've had some rest... writing scripts is addicting, although I don't understand how I spend 3 hours on 159 lines of script.... Edited August 7, 2008 by VindicatorOmega [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
BrettF Posted August 7, 2008 Share Posted August 7, 2008 MsgBox (0, "", _ColourInvert (0xFFFF00)) Func _ColourInvert ($code) Return "0x" & Hex (0xFFFFFF - $code, 6) EndFunc Worked for me Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
CHronologist Posted August 7, 2008 Share Posted August 7, 2008 (edited) I've written a script few days ago to do this to the whole screen sadly it's to slow to be a real effect but maybe it can also help. $dll = DllOpen("Gdi32.dll") $hwnd = DllCall("user32.dll", "hwnd", "GetActiveWindow") $dc = DllCall("user32.dll", "hwnd", "GetDC", "hwnd", $hwnd[0]) For $i = 0 to @DesktopWidth For $j = 0 to @DesktopHeight $rgb = DllCall($dll, "int", "GetPixel", "hwnd", $dc[0], "int", $i, "int", $j) $rgb[0] = BitNOT("0x" & Hex($RGB[0])) DllCall($dll, "int", "SetPixel", "hwnd", $dc[0], "int", $i, "int", $j, "int", "0x00" & StringTrimLeft(Hex($rgb[0]), 2)) Next Next DllClose($dll) If you have an idea how it can be done quicker let me know ;P Edited August 7, 2008 by CHronologist Link to comment Share on other sites More sharing options...
BrettF Posted August 7, 2008 Share Posted August 7, 2008 That is so cool.... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
CHronologist Posted August 7, 2008 Share Posted August 7, 2008 yeah looks pretty funny but is quite useless if it can't be refreshed fast enough to hold up the effect, maybe i'll start a new topic and hope someone with more experiance about gdi and gdiplus can help Link to comment Share on other sites More sharing options...
weaponx Posted August 7, 2008 Share Posted August 7, 2008 You can get some tips from this full screen blur script.http://www.autoitscript.com/forum/index.ph...hl=screen++blur Link to comment Share on other sites More sharing options...
Vindicator209 Posted August 7, 2008 Author Share Posted August 7, 2008 (edited) I've written a script few days ago to do this to the whole screen sadly it's to slow to be a real effect but maybe it can also help. $dll = DllOpen("Gdi32.dll") $hwnd = DllCall("user32.dll", "hwnd", "GetActiveWindow") $dc = DllCall("user32.dll", "hwnd", "GetDC", "hwnd", $hwnd[0]) For $i = 0 to @DesktopWidth For $j = 0 to @DesktopHeight $rgb = DllCall($dll, "int", "GetPixel", "hwnd", $dc[0], "int", $i, "int", $j) $rgb[0] = BitNOT("0x" & Hex($RGB[0])) DllCall($dll, "int", "SetPixel", "hwnd", $dc[0], "int", $i, "int", $j, "int", "0x00" & StringTrimLeft(Hex($rgb[0]), 2)) Next Next DllClose($dll) If you have an idea how it can be done quicker let me know ;P Well, you can do it like a TV screen, have one script do every OTHER vertical line, and another do the ones it missed Edited August 7, 2008 by VindicatorOmega [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
CHronologist Posted August 7, 2008 Share Posted August 7, 2008 I have opened an own post you can post your ideas there would be great 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