Skip to content

Commit 0c21e98

Browse files
author
csd0117
committed
add getDIBits
1 parent 46cb595 commit 0c21e98

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

gdi32.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ var (
982982
endPage uintptr
983983
extCreatePen uintptr
984984
getDeviceCaps uintptr
985+
getDIBits uintptr
985986
getEnhMetaFile uintptr
986987
getEnhMetaFileHeader uintptr
987988
getObject uintptr
@@ -1041,6 +1042,7 @@ func init() {
10411042
endPage = MustGetProcAddress(libgdi32, "EndPage")
10421043
extCreatePen = MustGetProcAddress(libgdi32, "ExtCreatePen")
10431044
getDeviceCaps = MustGetProcAddress(libgdi32, "GetDeviceCaps")
1045+
getDIBits = MustGetProcAddress(libgdi32, "GetDIBits")
10441046
getEnhMetaFile = MustGetProcAddress(libgdi32, "GetEnhMetaFileW")
10451047
getEnhMetaFileHeader = MustGetProcAddress(libgdi32, "GetEnhMetaFileHeader")
10461048
getObject = MustGetProcAddress(libgdi32, "GetObjectW")
@@ -1299,6 +1301,20 @@ func GetDeviceCaps(hdc HDC, nIndex int32) int32 {
12991301
return int32(ret)
13001302
}
13011303

1304+
func GetDIBits(hdc HDC, hbmp HBITMAP, uStartScan uint32, cScanLines uint32, lpvBits *byte, lpbi *BITMAPINFO, uUsage uint32) int32 {
1305+
ret, _, _ := syscall.Syscall9(getDIBits, 7,
1306+
uintptr(hdc),
1307+
uintptr(hbmp),
1308+
uintptr(uStartScan),
1309+
uintptr(cScanLines),
1310+
uintptr(unsafe.Pointer(lpvBits)),
1311+
uintptr(unsafe.Pointer(lpbi)),
1312+
uintptr(uUsage),
1313+
0,
1314+
0)
1315+
return int32(ret)
1316+
}
1317+
13021318
func GetEnhMetaFile(lpszMetaFile *uint16) HENHMETAFILE {
13031319
ret, _, _ := syscall.Syscall(getEnhMetaFile, 1,
13041320
uintptr(unsafe.Pointer(lpszMetaFile)),

0 commit comments

Comments
 (0)