 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
cool Guest
|
Posted: Wed May 14, 2008 10:50 am Post subject: ahk |
|
|
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
|
Posted: Wed May 14, 2008 11:03 am Post subject: |
|
|
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.
 |
|
| Back to top |
|
 |
Razlin
Joined: 05 Nov 2007 Posts: 288 Location: canada
|
Posted: Wed May 14, 2008 6:25 pm Post subject: |
|
|
@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 |
|
 |
Guest
|
Posted: Wed May 14, 2008 7:35 pm Post subject: |
|
|
| maybe |
|
| Back to top |
|
 |
pt80chip
Joined: 27 Feb 2008 Posts: 20
|
Posted: Wed May 14, 2008 10:14 pm Post subject: |
|
|
| I love it. I thought my subject lines were bad. |
|
| Back to top |
|
 |
cool Guest
|
Posted: Wed May 14, 2008 10:30 pm Post subject: |
|
|
| razlin could i have that script please? |
|
| Back to top |
|
 |
Razlin
Joined: 05 Nov 2007 Posts: 288 Location: canada
|
Posted: Thu May 15, 2008 1:37 pm Post subject: |
|
|
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 |
|
 |
cool Guest
|
Posted: Thu May 15, 2008 4:46 pm Post subject: |
|
|
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
|
Posted: Thu May 15, 2008 5:02 pm Post subject: |
|
|
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 |
|
 |
cool Guest
|
Posted: Thu May 15, 2008 5:22 pm Post subject: |
|
|
immediately when i press leftmouse button once, it says: Image completed  |
|
| Back to top |
|
 |
Razlin
Joined: 05 Nov 2007 Posts: 288 Location: canada
|
Posted: Thu May 15, 2008 5:41 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|