AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ahk

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
cool
Guest





PostPosted: Wed May 14, 2008 10:50 am    Post subject: ahk Reply with quote

anyone able to write a program in AHK that controls the mouse to automate drawing a preset black/white graphic?

that way i can draw nice pictures in msn messenger with the handwriting tihngy
Back to top
BoBoĻ
Guest





PostPosted: Wed May 14, 2008 11:03 am    Post subject: Reply with quote

Congrats, you've created the most minimalistic subject line ever!!
Let's think about if any supporter will get attracted this way to open the thread to review its content.

You're right this forum is about Autohotkey (ahk), and therefore all of users should have the right to use your intuitive subject line as a template, even more as it will save their braincells from being overloaded with searching for more descriptiptive one!!!

Looking forward to see the forum flodded with thousands of "ahk"-threads.

Confused
Back to top
Razlin



Joined: 05 Nov 2007
Posts: 288
Location: canada

PostPosted: Wed May 14, 2008 6:25 pm    Post subject: Reply with quote

@BoBo lol..

I actually do have a script that does something similar, it draws on the DC. just not on msn.

In short.. yes ahk can do it.

or as BoBo would say

-----
yes
-----
_________________
-=Raz=-
Back to top
View user's profile Send private message
Guest






PostPosted: Wed May 14, 2008 7:35 pm    Post subject: Reply with quote

maybe
Back to top
pt80chip



Joined: 27 Feb 2008
Posts: 20

PostPosted: Wed May 14, 2008 10:14 pm    Post subject: Reply with quote

I love it. I thought my subject lines were bad.
Back to top
View user's profile Send private message
cool
Guest





PostPosted: Wed May 14, 2008 10:30 pm    Post subject: Reply with quote

razlin could i have that script please?
Back to top
Razlin



Joined: 05 Nov 2007
Posts: 288
Location: canada

PostPosted: Thu May 15, 2008 1:37 pm    Post subject: Reply with quote

It does not do what you want but you can fiddle with it.
I managed to make some really cool effects with it

F2 creates an image text file you select the xy coords on your screen to make image.

F3 redraws that image to your screen.
you can manipulate the text file it creates to make cool effects.

c:\imagexy.txt
I removed all the black dots and ordred the file a-z,
the image is then drawn from darkest to lightest and all black is removed.
"used it for black and white images"

enjoy.

Code:
F2::
KeyWait, LButton, D
MouseGetPos, startx, starty

KeyWait, LButton
MouseGetPos, endx, endy

outputFile = c:\imagexy.txt

totalx := endx - startx
totaly := endy - starty
thisx := startx
thisy := starty

loop, %totaly%
{
     thisx := startx

     loop, %totalx%
     {
        PixelGetColor, MouseRGB, %thisx%, %thisy%
        imgx := thisx - startx
        imgy := thisy - starty
   FileAppend, %MouseRGB%|%imgx%|%imgy%`n, %outputFile%
   thisx++
     }

     thisy++
}

msgbox, Image file completed
traytip
Return


;##############SELECT THE FILE CREATED WITH F2   imagexy.txt
F3::
FileSelectFile, imageFile, 1, ,Please select the image text file, Image text file (*.txt)
if imageFile =
{
    MsgBox, Cancelling operation.
    return
}

DrwArea := DllCall("GetDC", "uint", Null)

tooltip Please click the top left corner of your screen.
KeyWait, LButton, D
tooltip
MouseGetPos, startx, starty

    Loop, Read, %imageFile%
    {
   imageFile = %A_LoopReadLine%
        StringSplit, fileline, imageFile, |
        xx := fileline2 + startx
        yy := fileline3 + starty
        DllCall("SetPixel", "uint", DrwArea, "int", xx, "int", yy, "uint", fileline1)
    }

traytip, Completed, image completed, 3
sleep 10000
DllCall("ReleaseDC", UInt, 0, UInt, DrwArea)  ;
DllCall("FreeLibrary", "UInt", DrwArea)
Return

_________________
-=Raz=-
Back to top
View user's profile Send private message
cool
Guest





PostPosted: Thu May 15, 2008 4:46 pm    Post subject: Reply with quote

thanks very much
but what do i have to put in the txt file?
Back to top
Razlin



Joined: 05 Nov 2007
Posts: 288
Location: canada

PostPosted: Thu May 15, 2008 5:02 pm    Post subject: Reply with quote

F2 creates the text file.

click once top left click again bottom right.

text file will contain image from first cilck to second click.

the scrpt creates the image.
_________________
-=Raz=-
Back to top
View user's profile Send private message
cool
Guest





PostPosted: Thu May 15, 2008 5:22 pm    Post subject: Reply with quote

immediately when i press leftmouse button once, it says: Image completed Surprised
Back to top
Razlin



Joined: 05 Nov 2007
Posts: 288
Location: canada

PostPosted: Thu May 15, 2008 5:41 pm    Post subject: Reply with quote

my bad.

click left drag release left thats your square.. oops.

havent used it in a while.

x click

o o
o
\_/
x release

imagexy.txt will have the image between the x.
_________________
-=Raz=-
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group