screenshot

package
v0.0.0-...-852f58a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	HORZRES          = 8   // 屏幕的宽度(物理)
	VERTRES          = 10  // 屏幕的高度(物理)
	DESKTOPHORZRES   = 118 // 屏幕的宽度(真实)
	DESKTOPVERTRES   = 117 // 屏幕的高度(真实)
	SM_CMONITORS     = 80  // 显示器个数
	BI_RGB           = 0
	InvalidParameter = 2
	DIB_RGB_COLORS   = 0
	SRCCOPY          = 0x00CC0020
)

Variables

This section is empty.

Functions

func BitBlt

func BitBlt(hdcDest HDC, nXDest, nYDest, nWidth, nHeight int, hdcSrc HDC, nXSrc, nYSrc int, dwRop uint) bool

func CaptureRect

func CaptureRect(rect image.Rectangle) (image.Image, error)

func CaptureScreen

func CaptureScreen() (image.Image, error)

func DeleteDC

func DeleteDC(hdc HDC) bool

func DeleteObject

func DeleteObject(hObject HGDIOBJ) bool

func GetDeviceCaps

func GetDeviceCaps(hdc HDC, index int) int

func GetSystemMetrics

func GetSystemMetrics(index int) int

func ReleaseDC

func ReleaseDC(h HWND, hDC HDC) bool

func SaveToFile

func SaveToFile(img image.Image, p string) error

func ScreenRect

func ScreenRect() (image.Rectangle, error)

Types

type BITMAPINFO

type BITMAPINFO struct {
	BmiHeader BITMAPINFOHEADER
	BmiColors *RGBQUAD
}

type BITMAPINFOHEADER

type BITMAPINFOHEADER struct {
	BiSize          uint32
	BiWidth         int32
	BiHeight        int32
	BiPlanes        uint16
	BiBitCount      uint16
	BiCompression   uint32
	BiSizeImage     uint32
	BiXPelsPerMeter int32
	BiYPelsPerMeter int32
	BiClrUsed       uint32
	BiClrImportant  uint32
}

type HANDLE

type HANDLE uintptr

type HDC

type HDC HANDLE

func CreateCompatibleDC

func CreateCompatibleDC(hdc HDC) HDC

func GetDC

func GetDC(h HWND) HDC

type HGDIOBJ

type HGDIOBJ HANDLE

func CreateDIBSection

func CreateDIBSection(hdc HDC, pBmi *BITMAPINFO, iUsage uint, ppvBits *unsafe.Pointer, hSection HANDLE, dwOffset uint) HGDIOBJ

func SelectObject

func SelectObject(hdc HDC, hGdiObj HGDIOBJ) HGDIOBJ

type HWND

type HWND HANDLE

type RGBQUAD

type RGBQUAD struct {
	RgbBlue     byte
	RgbGreen    byte
	RgbRed      byte
	RgbReserved byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL