Jump to content
Sign in to follow this  

Drawing between two graphic applications

Recommended Posts

Well i know the topic title is confusing...it confuses me too. So mods please change it into something more appropriate if its not suitable.

What i want to accomplish something thats a little weird but not impossible.

lets say i have two applications.

1) Adobe Photoshop

2) Microsoft Paint

in both these applications the dimensions of the picture will be the same. in photoshop there will be a picture lets say in 640x480 pixels and in mspaint there will be the same size layout but the difference is it will be empty.

what i need my automated app to do is.

1) In Photoshop go to color selector and select the first color of the first pixel (eg: 1,1 px)

2) Next i want the program to remember the colors webcolor value (eg #00000) or rgb value.

3) I want it to go to mspaint and go to the color chooser in mspaint and then fill up the values it got in photoshop.

4) Then i want it to go to the first pixel (1,1 px) and with the pencil tool put a single dot of that color.

I want my automated app to loop this until one by one all the pixels are filled and the picture in photoshop now appears in mspaint. Its like manually drawing it dot by dot except that the whole thing will be automated.

Yeah i know you'll be confused as to why im doing this. believe me i need the app to do it this way, i cant have it copy paste the picture. i want it to draw it dot by dot.

I would really appreciate you help. :)

Share this post

Link to post
Share on other sites

$pos = MouseGetPos()

$pos[0] = 61


WinActivate("Untitled - Paint", "") //i have photoshop already opened with the image i want.

$MC1 = PixelGetColor( $pos[0], $pos[1] ) //im getting the pixel colour of the bottom left corner

$MC2 = Hex($MC1, 6) //changing it to hex format

EnvSet("MouseColour", $MC2) //i didnt know how else to save the pixel colour information i got so i used this.

$MC = EnvGet("MouseColour")

MsgBox(0, "Colour is:", $MC)

WinActivate("Untitled", "") //this is the other program which i need the program to draw on

MouseClick("left", 398, 537, 1,0) //now its basically going to where you have to select the colour and clicking the color chooser.

Send("{DEL 6}") //this is really messy. what im doing here is erasing what was previously in the box where you input the colour

Send("{BACKSPACE 7}") //im doing this cos it inputted the colour wrong for me and i tried send Ctrl + A and it didnt work although when i do it manually it does.

Send($MC) //wrting the hex colour i got from the photoshop


MouseClick("left", 535, 347, 1,0) //clicking the bottom right corner of the empty drawing. when we click it will draw with the colour we set above.

$pos[1] = $pos[1] - 1 //what im doing is moving the cusor up.

MouseMove($pos[0], $pos[1])

Until $pos = 12313123 //this is currently bull$hit i wrote cos i didnt know what to write here. basically what i want it to do is when the mouse cursor reaches the top of the image i want it to move to the left and go down from there going down pixel by pixel again.

So what im looking for now is a way to loop until it draws the whole document pixel by pixel. the concept is getting the pixel colour from photoshop and then inputing it to the other app and making a click so it will draw 1 pixel. loop until the whole document gets drawn.

Thanks in advance :)


Reilly Klevre

Edited by ReillyKlevre

Share this post

Link to post
Share on other sites

Not looking too deeply at what you have an idea would be to have an embedded for loop in a for loop, or do while if it's easier.


For $i 1 to (how tall your image is) step 1

for $r to (how wide your image is) step 1

Your code here.....



That'll do line 1, then line 2, then line 3 etc...

I hope it helps lol

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...