Screenshot of part of the screen Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mkoppelgaard
Posts: 4
Joined: 08 Dec 2022, 04:28

Screenshot of part of the screen

Post by mkoppelgaard » 08 Dec 2022, 04:40

I would like to take a screenshot of part of the screen and put it into clipboard.
I found this code, which put a screenshot into a file, but I want it to clipboard instead. What can I do?

Code: Select all

#include C:\Users\username\Documents\Other\AutoHotkey Scripts\Gdip.ahk

^u::
; Charts
pToken := Gdip_Startup()

snap := Gdip_BitmapFromScreen("1400|148|1142|1163")
Gdip_SaveBitmapToFile(snap, "C:\Users\username\Documents\Other\AutoHotkey Scripts\test.png")

Gdip_DisposeImage(snap)
Return

User avatar
mikeyww
Posts: 26848
Joined: 09 Sep 2014, 18:38

Re: Screenshot of part of the screen  Topic is solved

Post by mikeyww » 08 Dec 2022, 05:43

Code: Select all

Gdip_SetBitmapToClipboard(snap)

Post Reply

Return to “Ask for Help (v1)”