How to paste clipboard to paint?
-
- Posts: 51
- Joined: 03 Mar 2017, 04:51
How to paste clipboard to paint?
I want to paste an image from my clipboard to a new paint window. My problem is, that if the image is smaller that a certain size, thre will be a white border left. Is there an easy way to get rid of that?
Re: How to paste clipboard to paint?
Simply re-scale the size of a new window to 1x1 px. Once you paste a new content to it it will be enlarged to its captured size.
Beside that you could use GDI+ to create an image from a variable/the clipboard without using MSPaint.
Beside that you could use GDI+ to create an image from a variable/the clipboard without using MSPaint.
-
- Posts: 51
- Joined: 03 Mar 2017, 04:51
Re: How to paste clipboard to paint?
Is there an easy command to do that to a paint window? If I simply make it smaller the drawing area stays the same.BoBo wrote:Simply re-scale the size of a new window to 1x1 px. Once you paste a new content to it it will be enlarged to its captured size.
Beside that you could use GDI+ to create an image from a variable/the clipboard without using MSPaint.
Re: How to paste clipboard to paint?
Example
Code: Select all
#SingleInstance, Force
MainAppTitle := "Untitled - Paint ahk_class MSPaintApp ahk_exe mspaint.exe"
PropertiesTitle := "Image Properties ahk_class #32770 ahk_exe mspaint.exe"
F1::
ControlSend, ahk_parent, ^e, % MainAppTitle ; Open "Image Properties" window
WinWait, % PropertiesTitle ; Wait for window to appear
Control, Check,, Button8, % PropertiesTitle ; Choose "Pixels" as Unit
ControlSetText, Edit1, 1, % PropertiesTitle ; Set Width to 1
ControlSetText, Edit2, 1, % PropertiesTitle ; Set Height to 1
ControlSend, Button3, {Enter}, % PropertiesTitle ; Trigger "OK" button
WinWaitClose, % PropertiesTitle,, 1 ; Wait for window to close
Sleep, 100 ; Wait 100 milliseconds
Send, {Alt Down}{PrintScreen}{Alt Up} ; Copy image of active window
ControlSend, ahk_parent, ^v, % MainAppTitle ; Paste copied image to mspaint
return