Jump to content

Drawing Individual Pixels


Elink
 Share

Go to solution Solved by iamtheky,

Recommended Posts

I just started AutoIt a few days ago, so I don't really know my way around. I tried looking at the the example scripts and reading through the entire wiki, but that didn't give me any ideas, so...

Is there a way to manipulate individual pixels in your GUI? It would be great to just give me a function and its usage.

Link to comment
Share on other sites

I find it very difficult to believe you even read the beginning of the help file, never mind a forum search and the entire wiki.

Apart from there being tons of stuff about what you ask, you just asked if AutoIt works on linux.

That's like me saying I read an entire car manual and then took it to the garage to have square wheels fitted.

Please be truthful.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

I never asked if it works on Linux. I asked whether I could cross-compile to Linux - there is a huge difference.

And what "tons of stuff" are you referring to? This is only my second post, and given how badly you misinterpreted my first one, I doubt you really even know what you're referring to.

Oh, and don't reply to people's questions unless you're doing to say something useful. Telling me how much you hate my post is not constructive, you would have been better off just staying silent.

By the way, no need to give me your 'absolute beginners' tutorial. I do know how to use the help file, and I have plenty of programming experience; this is my second language, and I'm already very good at Lua. Don't make assumptions.

Edited by Elink
Link to comment
Share on other sites

This may be late, but whatever.

What do you mean by pixels on the GUI? 

Do you mean the little black dots that you see separated from each other in the GUI editor?

They are there for guide lines I believe... they disappear after you run the GUI.

Can you be a little bit more specific so I can get back at you?

Link to comment
Share on other sites

  • 2 weeks later...
  • Solution

This function is all over the place.  So your Lua skills may be legit, but your search skills suck.

Func _PixelSetColor($XCoord, $YCoord, $Color)
    Local $dc = DllCall("user32.dll", "int", "GetDC", "hwnd", 0)
    If Not IsArray($dc) Then Return -1
    DllCall("gdi32.dll", "long", "SetPixel", "long", $dc[0], "long", $XCoord, "long", $YCoord, "long", _
            "0x" & StringRegExpReplace(hex($Color,6), "(..)(..)(..)", "\3\2\1")) ; Change to 0xBBGGRR hex colour format.
    DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "hwnd", $dc[0])
EndFunc ;==>_PixelSetColor

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Come to think of it, I should have been a bit more specific...

I was asking if there is a way to manipulate individual pixels on the monitor, instead of inside a traditional GUI.

 

GetDC(0) gives you desktop DC so you can use SetPixel for painting on Desktop the same way as on any GUI window.

Link to comment
Share on other sites

eh, sometimes you get mocked and help, other times just mocked.  You will eventually be pleased with any responses at all.

 

Here is a small script that sets pixels on the GUI thrown by progresson.

Reading all UEZ's stuff should be requisite when learning to color, would have saved me from writing that.

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...