However, i would like to ask if someone knows how to use a pBitmap created from GDI like:
Code: Select all
pbitmap := Gdip_BitmapFromScreen(0)
code:
Code: Select all
clipboard := ""
gdipToken := Gdip_Startup()
t1:=A_TickCount
pbitmap := Gdip_BitmapFromScreen(0)
pbitmap2 = C:\Users\Downloads\y.png
; -------------------------------------------------------------------------------------------------------------------
; Read the image file
; -------------------------------------------------------------------------------------------------------------------
File := FileOpen(pbitmap2, "r")
BinLen := File.Length
File.RawRead(Bin, BinLen)
File.Close()
; -------------------------------------------------------------------------------------------------------------------
; Encode the image file
; -------------------------------------------------------------------------------------------------------------------
DllCall("Crypt32.dll\CryptBinaryToString", "Ptr", &Bin, "UInt", BinLen, "UInt", 0x01, "Ptr", 0, "UIntP", B64Len)
VarSetCapacity(B64, B64Len << !!A_IsUnicode, 0)
DllCall("Crypt32.dll\CryptBinaryToString", "Ptr", &Bin, "UInt", BinLen, "UInt", 0x01, "Ptr", &B64, "UIntP", B64Len)
Bin := ""
VarSetCapacity(Bin, 0)
VarSetCapacity(B64, -1)
B64 := RegExReplace(B64, "\r\n")
B64Len := StrLen(B64)
; -------------------------------------------------------------------------------------------------------------------
PartLength := 16000
CharsRead := 1
Part := ""
While (CharsRead < B64Len) {
clipboard .= Part . SubStr(b64, CharsRead, PartLength)
CharsRead += PartLength
}
tTime := (A_TickCount-t1)
FileAppend time: %tTime% `n, *
FileAppend, %clipboard% , *
return
https://en.it1352.com/article/c43b7af5ff9f45169bec20cfda65d48b.html
Currently trying to convert it to AHK