BitMap beschriften

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

effel
Posts: 542
Joined: 16 Jan 2018, 13:34

BitMap beschriften

Post by effel » 10 Jul 2021, 10:21

Hallo,

ich versuche mich an 'HBITMAP' und möchte die BitMap beschriften und Icons darauf positionieren.

Ist das möglich? Ich möchte die BitMap dann speichern können.

Von diesem Schnipsel wurde ich inspiriert: ; dabei weiß ich nichtmal ob das für diesen Zweck die richtige Methode ist, eine BitMap zu erstellen

Code: Select all

; https://www.autohotkey.com/boards/viewtopic.php?p=380960#p380960
;hBM1 := DllCall("CreateBitmap", "Int",1, "Int",1, "Int",1, "Int",32, "IntP",0xfcfcfc, "Ptr") ; transparent
 hBM1 := DllCall("CreateBitmap", "Int",1, "Int",1, "Int",1, "Int",32, "IntP",0xfcfcfd, "Ptr")
Gui, -Caption +AlwaysOnTop +Owner +LastFound +E0x20
WinSet, TransColor, fcfcfc
Gui, Color, fcfcfc
Gui, Add, Picture,         h512 w256 BackgroundTrans, HBITMAP:%hBM1%
Gui, Show,,

Dank Google konnte ich passende Icons finden, sie haben transparenten Hintergrund und lassen sich leider nicht hier hochladen.
Daher poste ich den ScreenShot..

hmm, auch der jpg screenShot lässt sich nicht ins Forum laden. Die Bilddatei, die Sie anzuhängen versucht haben, ist ungültig.
Hier ein Link für ein Beispiel Icon https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT5cR4_rJmgHc7YQCduRSG--gXZyDUmvawLkA&usqp=CAU
Sind meine Posts zu Bunt? oder ist das eine neue Forum Direktive?

Wie lege ich ein WetterIcon auf die BitMap?
Last edited by effel on 10 Jul 2021, 12:45, edited 2 times in total.
gregster
Posts: 8916
Joined: 30 Sep 2013, 06:48

Re: BitMap beschriften

Post by gregster » 10 Jul 2021, 11:29

effel wrote:
10 Jul 2021, 10:21
hmm, auch der jpg screenShot lässt sich nicht ins Forum laden. Die Bilddatei, die Sie anzuhängen versucht haben, ist ungültig.
Hier ein Link für ein Beispiel Icon https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT5cR4_rJmgHc7YQCduRSG--gXZyDUmvawLkA&usqp=CAU
Sind meine Posts zu Bunt? oder ist das eine neue Forum Direktive?
Nö, das Hochladen von Bildern ist leider derzeit generell kaputt. tank bereitet wohl größere Updates vor und hat die Funktion dabei zerschossen.
effel
Posts: 542
Joined: 16 Jan 2018, 13:34

Re: BitMap beschriften

Post by effel » 10 Jul 2021, 12:43

danke gregster wie beruhigend
just me
Posts: 9424
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: BitMap beschriften

Post by just me » 14 Jul 2021, 05:02

Moin,

um das möglichst einfach zu gestalten könntest Du versuchen, Bilder, Texte und Icons in einem AHK-Fenster übereinander zu legen und das Resultat mit einem 'Snipping Tool' als Bild zu speichern.
effel
Posts: 542
Joined: 16 Jan 2018, 13:34

Re: BitMap beschriften

Post by effel » 14 Jul 2021, 15:53

hallo

danke ich habe es mal so umgesetzt. Das sieht auch ganz ok aus, wenn ich jedoch heran zoome verpixelt es. Ich hatte die Hoffnung das die Ränder bei der BitMap Version glatt sind


Unbenannt.png
Unbenannt.png (38.32 KiB) Viewed 2079 times

Code: Select all

;BitMap beschriften
;https://www.autohotkey.com/boards/viewtopic.php?p=410097&sid=0f150ab25c6da4ff3029061ed4761da2#p410097
#SingleInstance force
#NoEnv
#Persistent
FileEncoding, UTF-8
SetBatchLines, -1
SetTitleMatchMode, 2
SetKeyDelay 20
SetWorkingDir, %A_ScriptDir%
ANow := A_Now
If !FileExist(A_ScriptDir "\save\")
FileCreateDir,% A_ScriptDir "\save\"
FileCopy, % A_ScriptFullPath, % A_ScriptDir "\save\" A_ScriptName " save " A_Now " .ahk"


; https://www.autohotkey.com/boards/viewtopic.php?p=380960#p380960
 hBM1 := DllCall("CreateBitmap", "Int",1, "Int",1, "Int",1, "Int",32, "IntP",0xfcfcfc, "Ptr") ; transparent
; hBM1 := DllCall("CreateBitmap", "Int",1, "Int",1, "Int",1, "Int",32, "IntP",0xfcfcfd, "Ptr")
Gui, -Caption +AlwaysOnTop +Owner +LastFound +E0x20
WinSet, TransColor, fcfcfc
Gui, Color, fcfcfc
Gui, Add, Picture, h512 w256 BackgroundTrans, HBITMAP:%hBM1%
   Gui, font, s16
Gui, Add, Text, x5 y3, testtext
Gui, Show,,
   File := A_Now ".jpg"
   hBM := hWnd_to_hBmp(WinExist("A"), True, [0,0,256,512] )     ; Capture active window. Part of client area
   GDIP("Startup")
   SavePicture(hBM, File)
   GDIP("Shutdown")
   DllCall("DeleteObject", "Ptr", hBM)
   Run %File%
Return



/*
res := hWnd_to_hBmp( -1 )                                   ; Fullscreen capture. 
hWnd_to_hBmp()                                       ; Same as above
hWnd_to_hBmp( WinExist("A") )                        ; Capture active window
hWnd_to_hBmp( WinExist("A"), True )                  ; Capture active window. Client area
hWnd_to_hBmp( WinExist("A"), True, [0,0,64,64] )     ; Capture active window. Part of client area

; Capturing owner window in fullscreen mode
WinGetPos, X, Y, W, H, PSPad
Array := [X,Y,W,H]
hBM := hWnd_to_hBmp(-1, False, Array ) 

; Capturing secondary monitor
SysGet, X, MonitorWorkArea, 2
Array := [XLEFT, XTOP, XRIGHT-XLEFT, XBOTTOM-XTOP]
hBM := hWnd_to_hBmp( -1, False, Array )
*/



;https://www.autohotkey.com/boards/viewtopic.php?f=6&t=67778
;https://www.autohotkey.com/boards/viewtopic.php?&t=67716

hWnd_to_hBmp( hWnd:=-1, Client:=0, A:="", C:="" ) {      ; By SKAN C/M on D295|D299 @ bit.ly/2lyG0sN

; Capture fullscreen, Window, Control or user defined area of these

  A      := IsObject(A) ? A : StrLen(A) ? StrSplit( A, ",", A_Space ) : {},     A.tBM := 0
  Client := ( ( A.FS := hWnd=-1 ) ? False : !!Client ), A.DrawCursor := "DrawCursor"
  hWnd   := ( A.FS ? DllCall( "GetDesktopWindow", "UPtr" ) : WinExist( "ahk_id" . hWnd ) )

  A.SetCapacity( "WINDOWINFO", 62 ),  A.Ptr := A.GetAddress( "WINDOWINFO" ) 
  A.RECT := NumPut( 62, A.Ptr, "UInt" ) + ( Client*16 )  

  If  ( DllCall( "GetWindowInfo",   "Ptr",hWnd, "Ptr",A.Ptr )
    &&  DllCall( "IsWindowVisible", "Ptr",hWnd )
    &&  DllCall( "IsIconic",        "Ptr",hWnd ) = 0 ) 
    {
        A.L := NumGet( A.RECT+ 0, "Int" ),     A.X := ( A.1 <> "" ? A.1 : (A.FS ? A.L : 0) )  
        A.T := NumGet( A.RECT+ 4, "Int" ),     A.Y := ( A.2 <> "" ? A.2 : (A.FS ? A.T : 0 )) 
        A.R := NumGet( A.RECT+ 8, "Int" ),     A.W := ( A.3  >  0 ? A.3 : (A.R - A.L - Round(A.1)) ) 
        A.B := NumGet( A.RECT+12, "Int" ),     A.H := ( A.4  >  0 ? A.4 : (A.B - A.T - Round(A.2)) )
        
        A.sDC := DllCall( Client ? "GetDC" : "GetWindowDC", "Ptr",hWnd, "UPtr" )
        A.mDC := DllCall( "CreateCompatibleDC", "Ptr",A.sDC, "UPtr")
        A.tBM := DllCall( "CreateCompatibleBitmap", "Ptr",A.sDC, "Int",A.W, "Int",A.H, "UPtr" )

        DllCall( "SaveDC", "Ptr",A.mDC )
        DllCall( "SelectObject", "Ptr",A.mDC, "Ptr",A.tBM )
        DllCall( "BitBlt",       "Ptr",A.mDC, "Int",0,   "Int",0, "Int",A.W, "Int",A.H
                               , "Ptr",A.sDC, "Int",A.X, "Int",A.Y, "UInt",0x40CC0020 )  

        A.R := ( IsObject(C) || StrLen(C) ) && IsFunc( A.DrawCursor ) ? A.DrawCursor( A.mDC, C ) : 0
        DllCall( "RestoreDC", "Ptr",A.mDC, "Int",-1 )
        DllCall( "DeleteDC",  "Ptr",A.mDC )   
        DllCall( "ReleaseDC", "Ptr",hWnd, "Ptr",A.sDC )
    }        
Return A.tBM
}

SavePicture(hBM, sFile) {                                            ; By SKAN on D293 @ bit.ly/2krOIc9
Local V,  pBM := VarSetCapacity(V,16,0)>>8,  Ext := LTrim(SubStr(sFile,-3),"."),  E := [0,0,0,0]
Local Enc := 0x557CF400 | Round({"bmp":0, "jpg":1,"jpeg":1,"gif":2,"tif":5,"tiff":5,"png":6}[Ext])
  E[1] := DllCall("gdi32\GetObjectType", "Ptr",hBM ) <> 7
  E[2] := E[1] ? 0 : DllCall("gdiplus\GdipCreateBitmapFromHBITMAP", "Ptr",hBM, "UInt",0, "PtrP",pBM)
  NumPut(0x2EF31EF8,NumPut(0x0000739A,NumPut(0x11D31A04,NumPut(Enc+0,V,"UInt"),"UInt"),"UInt"),"UInt")
  E[3] := pBM ? DllCall("gdiplus\GdipSaveImageToFile", "Ptr",pBM, "WStr",sFile, "Ptr",&V, "UInt",0) : 1
  E[4] := pBM ? DllCall("gdiplus\GdipDisposeImage", "Ptr",pBM) : 1
Return E[1] ? 0 : E[2] ? -1 : E[3] ? -2 : E[4] ? -3 : 1  
}

GDIP(C:="Startup") {                                      ; By SKAN on D293 @ bit.ly/2krOIc9
  Static SI:=Chr(!(VarSetCapacity(Si,24,0)>>16)), pToken:=0, hMod:=0, Res:=0, AOK:=0
  If (AOK := (C="Startup" and pToken=0) Or (C<>"Startup" and pToken<>0))  {
      If (C="Startup") {
               hMod := DllCall("LoadLibrary", "Str","gdiplus.dll", "Ptr")
               Res  := DllCall("gdiplus\GdiplusStartup", "PtrP",pToken, "Ptr",&SI, "UInt",0)
      } Else { 
               Res  := DllCall("gdiplus\GdiplusShutdown", "Ptr",pToken)
               DllCall("FreeLibrary", "Ptr",hMod),   hMod:=0,   pToken:=0
   }}  
Return (AOK ? !Res : Res:=0)    
}
just me
Posts: 9424
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: BitMap beschriften

Post by just me » 15 Jul 2021, 04:27

Moin,

der einzige Unterschied zwischen bmp und jpg ist, dass jpg versucht, die Pixeldaten zu komprimieren. Wenn das nicht mit einer Qualitätsvorgabe von 100 % erfolgt, gehen üblicherweise Bildinformationen verloren. Beide Formate enthalten aber für jedes Pixel der Bitmap genau einen Wert. Beim Skalieren hängt nun Alles davon ab, wie die Anwendung das macht. Die Fotoanzeige scheint einfach jedes Pixel zu vergrößern. Das ergibt dann irgendwann diese 'Klötzchenstrukturen'. Andere Anwendungen wie IrfanView oder XnView können bei der Skalierung Zwischenwerte für hinzugefügte Pixel errechnen. Das sieht dann bis zu einer bestimmten Vergrößerungsstufe 'glatter' aus, lässt aber die Konturen verschwimmen.

Du kannst ja mal als bmp speichern und vergleichen:

Code: Select all

   
   hBM := hWnd_to_hBmp(WinExist("A"), True, [0,0,256,512] )     ; Capture active window. Part of client area
   GDIP("Startup")
   File := A_Now ".bmp"
   SavePicture(hBM, File)
Wenn Du nur wissen willst, wie man diese Lösung ohne GDI+ realisiert, habe ich etwas.
effel
Posts: 542
Joined: 16 Jan 2018, 13:34

Re: BitMap beschriften

Post by effel » 16 Jul 2021, 13:04

just me wrote:
15 Jul 2021, 04:27
Wenn Du nur wissen willst, wie man diese Lösung ohne GDI+ realisiert, habe ich etwas.
Super, BMP war die Lösung. Sauber selbst bei extremer Vergrößerung


Unbenannt.png
Unbenannt.png (9.28 KiB) Viewed 2024 times



Ich bin natürlich auch an der Version ohne GDI+ interessiert, wenn du Lust und Zeit findest...
just me
Posts: 9424
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: BitMap beschriften

Post by just me » 17 Jul 2021, 04:55

Moin,

dann versuch das mal:

Code: Select all

SaveHBITMAPToFile(hBitmap, sFile) {
   Static SizeBM := A_PtrSize = 8 ? 32 : 24     ; BITMAP
        , SizeBMFH := 14                        ; BITMAPFILEHEADER
        , SizeBMIH := 40                        ; BITMAPINFOHEADER
        , SizeDIB := A_PtrSize = 8 ? 104 : 84   ; DIBSECTION
   HDIB := DllCall("CopyImage", "Ptr", hBitmap, "UInt", 0, "Int", 0, "Int", 0, "UInt", 0x2000, "UPtr")
   VarSetCapacity(DIB, SizeDIB, 0)
   DllCall("GetObject", "Ptr", HDIB, "Int", SizeDIB, "Ptr", &DIB)
   Size := NumGet(DIB, A_PtrSize = 8 ? 52 : 44, "UInt")
   hFile := FileOpen(sFile, "w", "CP0")
   ; BITMAPFILEHEADER
   hFile.Write("BM")                            ; bfType
   hFile.WriteUInt(SizeBMFH + SizeBMIH + Size)  ; bfSize
   hFile.WriteUInt(0)                           ; bfReserved
   hFile.WriteUInt(SizeBMFH + SizeBMIH)         ; bfOffBits
   ; BITMAPINFOHEADER
   hFile.RawWrite(&DIB + SizeBM, SizeBMIH)
   ; bmBits
   hFile.RawWrite(NumGet(DIB, A_PtrSize = 8 ? 24 : 20, "UPtr"), Size)
   hFile.Close()
   DllCall("DeleteObject", "Ptr", HDIB)
}
Damit wird immer eine Datei im Format BMP erstellt. Der ursprüngliche Code stammt aus Sean's ScreenCapture Skript im alten Forum.
effel
Posts: 542
Joined: 16 Jan 2018, 13:34

Re: BitMap beschriften

Post by effel » 18 Jul 2021, 13:44

das funktioniert wie erhofft, danke für deine Zeit.

Code: Select all

;BitMap beschriften
;https://www.autohotkey.com/boards/viewtopic.php?f=9&t=92511
; https://www.autohotkey.com/boards/viewtopic.php?p=380960#p380960

 hBM1 := DllCall("CreateBitmap", "Int",1, "Int",1, "Int",1, "Int",32, "IntP",0xfcfcfc, "Ptr") ; transparent
; hBM1 := DllCall("CreateBitmap", "Int",1, "Int",1, "Int",1, "Int",32, "IntP",0xfcfcfd, "Ptr")
Gui, -Caption +AlwaysOnTop +Owner +LastFound +E0x20
WinSet, TransColor, fcfcfc
Gui, Color, fcfcfc
Gui, Add, Picture, h512 w256 BackgroundTrans, HBITMAP:%hBM1%
   Gui, font, s16
Gui, Add, Text, x5 y3, testtext
Gui, Show,,
   File := A_Now "_SaveHBITMAPToFile.bmp"
   File2 := A_Now "_SavePicture.bmp"
   hBM := hWnd_to_hBmp(WinExist("A"), True, [0,0,256,512] )     ; Capture active window. Part of client area

SaveHBITMAPToFile(hbm, File)
FileRead,File,%File%
FileGetSize,FileSize,%File%

;/*
   GDIP("Startup")
   SavePicture(hBM, File2)
   GDIP("Shutdown")
   DllCall("DeleteObject", "Ptr", hBM)
FileRead,File2,%File2%
FileGetSize,FileSize2,%File2%
;*/

;   Run %File%



MsgBox % Calc_MD5(&File,FileSize) "`n"
       . Calc_MD5(&File2,FileSize2)

Return



/*
res := hWnd_to_hBmp( -1 )                                   ; Fullscreen capture. 
hWnd_to_hBmp()                                       ; Same as above
hWnd_to_hBmp( WinExist("A") )                        ; Capture active window
hWnd_to_hBmp( WinExist("A"), True )                  ; Capture active window. Client area
hWnd_to_hBmp( WinExist("A"), True, [0,0,64,64] )     ; Capture active window. Part of client area

; Capturing owner window in fullscreen mode
WinGetPos, X, Y, W, H, PSPad
Array := [X,Y,W,H]
hBM := hWnd_to_hBmp(-1, False, Array ) 

; Capturing secondary monitor
SysGet, X, MonitorWorkArea, 2
Array := [XLEFT, XTOP, XRIGHT-XLEFT, XBOTTOM-XTOP]
hBM := hWnd_to_hBmp( -1, False, Array )
*/

SaveHBITMAPToFile(hBitmap, sFile) {  ; https://www.autohotkey.com/boards/viewtopic.php?p=410517 by Just Me
   Static SizeBM := A_PtrSize = 8 ? 32 : 24     ; BITMAP
        , SizeBMFH := 14                        ; BITMAPFILEHEADER
        , SizeBMIH := 40                        ; BITMAPINFOHEADER
        , SizeDIB := A_PtrSize = 8 ? 104 : 84   ; DIBSECTION
   HDIB := DllCall("CopyImage", "Ptr", hBitmap, "UInt", 0, "Int", 0, "Int", 0, "UInt", 0x2000, "UPtr")
   VarSetCapacity(DIB, SizeDIB, 0)
   DllCall("GetObject", "Ptr", HDIB, "Int", SizeDIB, "Ptr", &DIB)
   Size := NumGet(DIB, A_PtrSize = 8 ? 52 : 44, "UInt")
   hFile := FileOpen(sFile, "w", "CP0")
   ; BITMAPFILEHEADER
   hFile.Write("BM")                            ; bfType
   hFile.WriteUInt(SizeBMFH + SizeBMIH + Size)  ; bfSize
   hFile.WriteUInt(0)                           ; bfReserved
   hFile.WriteUInt(SizeBMFH + SizeBMIH)         ; bfOffBits
   ; BITMAPINFOHEADER
   hFile.RawWrite(&DIB + SizeBM, SizeBMIH)
   ; bmBits
   hFile.RawWrite(NumGet(DIB, A_PtrSize = 8 ? 24 : 20, "UPtr"), Size)
   hFile.Close()
   DllCall("DeleteObject", "Ptr", HDIB)
}


;https://www.autohotkey.com/boards/viewtopic.php?f=6&t=67778
;https://www.autohotkey.com/boards/viewtopic.php?&t=67716
hWnd_to_hBmp( hWnd:=-1, Client:=0, A:="", C:="" ) {      ; By SKAN C/M on D295|D299 @ bit.ly/2lyG0sN

; Capture fullscreen, Window, Control or user defined area of these

  A      := IsObject(A) ? A : StrLen(A) ? StrSplit( A, ",", A_Space ) : {},     A.tBM := 0
  Client := ( ( A.FS := hWnd=-1 ) ? False : !!Client ), A.DrawCursor := "DrawCursor"
  hWnd   := ( A.FS ? DllCall( "GetDesktopWindow", "UPtr" ) : WinExist( "ahk_id" . hWnd ) )

  A.SetCapacity( "WINDOWINFO", 62 ),  A.Ptr := A.GetAddress( "WINDOWINFO" ) 
  A.RECT := NumPut( 62, A.Ptr, "UInt" ) + ( Client*16 )  

  If  ( DllCall( "GetWindowInfo",   "Ptr",hWnd, "Ptr",A.Ptr )
    &&  DllCall( "IsWindowVisible", "Ptr",hWnd )
    &&  DllCall( "IsIconic",        "Ptr",hWnd ) = 0 ) 
    {
        A.L := NumGet( A.RECT+ 0, "Int" ),     A.X := ( A.1 <> "" ? A.1 : (A.FS ? A.L : 0) )  
        A.T := NumGet( A.RECT+ 4, "Int" ),     A.Y := ( A.2 <> "" ? A.2 : (A.FS ? A.T : 0 )) 
        A.R := NumGet( A.RECT+ 8, "Int" ),     A.W := ( A.3  >  0 ? A.3 : (A.R - A.L - Round(A.1)) ) 
        A.B := NumGet( A.RECT+12, "Int" ),     A.H := ( A.4  >  0 ? A.4 : (A.B - A.T - Round(A.2)) )
        
        A.sDC := DllCall( Client ? "GetDC" : "GetWindowDC", "Ptr",hWnd, "UPtr" )
        A.mDC := DllCall( "CreateCompatibleDC", "Ptr",A.sDC, "UPtr")
        A.tBM := DllCall( "CreateCompatibleBitmap", "Ptr",A.sDC, "Int",A.W, "Int",A.H, "UPtr" )

        DllCall( "SaveDC", "Ptr",A.mDC )
        DllCall( "SelectObject", "Ptr",A.mDC, "Ptr",A.tBM )
        DllCall( "BitBlt",       "Ptr",A.mDC, "Int",0,   "Int",0, "Int",A.W, "Int",A.H
                               , "Ptr",A.sDC, "Int",A.X, "Int",A.Y, "UInt",0x40CC0020 )  

        A.R := ( IsObject(C) || StrLen(C) ) && IsFunc( A.DrawCursor ) ? A.DrawCursor( A.mDC, C ) : 0
        DllCall( "RestoreDC", "Ptr",A.mDC, "Int",-1 )
        DllCall( "DeleteDC",  "Ptr",A.mDC )   
        DllCall( "ReleaseDC", "Ptr",hWnd, "Ptr",A.sDC )
    }        
Return A.tBM
}

SavePicture(hBM, sFile) {                                            ; By SKAN on D293 @ bit.ly/2krOIc9
Local V,  pBM := VarSetCapacity(V,16,0)>>8,  Ext := LTrim(SubStr(sFile,-3),"."),  E := [0,0,0,0]
Local Enc := 0x557CF400 | Round({"bmp":0, "jpg":1,"jpeg":1,"gif":2,"tif":5,"tiff":5,"png":6}[Ext])
  E[1] := DllCall("gdi32\GetObjectType", "Ptr",hBM ) <> 7
  E[2] := E[1] ? 0 : DllCall("gdiplus\GdipCreateBitmapFromHBITMAP", "Ptr",hBM, "UInt",0, "PtrP",pBM)
  NumPut(0x2EF31EF8,NumPut(0x0000739A,NumPut(0x11D31A04,NumPut(Enc+0,V,"UInt"),"UInt"),"UInt"),"UInt")
  E[3] := pBM ? DllCall("gdiplus\GdipSaveImageToFile", "Ptr",pBM, "WStr",sFile, "Ptr",&V, "UInt",0) : 1
  E[4] := pBM ? DllCall("gdiplus\GdipDisposeImage", "Ptr",pBM) : 1
Return E[1] ? 0 : E[2] ? -1 : E[3] ? -2 : E[4] ? -3 : 1  
}

GDIP(C:="Startup") {                                      ; By SKAN on D293 @ bit.ly/2krOIc9
  Static SI:=Chr(!(VarSetCapacity(Si,24,0)>>16)), pToken:=0, hMod:=0, Res:=0, AOK:=0
  If (AOK := (C="Startup" and pToken=0) Or (C<>"Startup" and pToken<>0))  {
      If (C="Startup") {
               hMod := DllCall("LoadLibrary", "Str","gdiplus.dll", "Ptr")
               Res  := DllCall("gdiplus\GdiplusStartup", "PtrP",pToken, "Ptr",&SI, "UInt",0)
      } Else { 
               Res  := DllCall("gdiplus\GdiplusShutdown", "Ptr",pToken)
               DllCall("FreeLibrary", "Ptr",hMod),   hMod:=0,   pToken:=0
   }}  
Return (AOK ? !Res : Res:=0)    
}
; https://autohotkey.com/board/topic/77408-md5-function-for-comparing-images/
Calc_MD5(_VarAddress, _VarSize){
	Static Hex = "123456789ABCDEF0"
	Ptr := A_PtrSize ? "Ptr" : "Uint"
	, VarSetCapacity(MD5_CTX,104,0)
	, DllCall("advapi32\MD5Init",Ptr,&MD5_CTX)
	, DllCall("advapi32\MD5Update",Ptr,&MD5_CTX,Ptr,_VarAddress,"UInt",_VarSize)
	, DllCall("advapi32\MD5Final",Ptr,&MD5_CTX)
	Loop,16
	N := NumGet( MD5_CTX,87+A_Index,"Char"), MD5 .= SubStr(Hex,N>>4,1) . SubStr(Hex,N&15,1)
	Return MD5
}




Hier habe ich sicherlich etwas falsch verstanden. Es werden nur leere Dateien mit 54 Bytes angelegt.
Die Zeile GuiControl, , Bild, % "HBITMAP:*" Bilder[Mod(A_Index, Bilder.Length())+1] verleitete mich dazu anzunehmen, das es sich auch um eine gültige 'HBITMAP' Datei handelt.

Code: Select all

;LoadPicture  Syntax  Verwendung  AutoHotkey
;https://ahkde.github.io/docs/commands/LoadPicture.htm
;https://ahkde.github.io/docs/commands/LoadPicture.htm#ExSlideShow

Bilder := []
; Findet einige Bilder zum Anzeigen.
Loop, Files, %A_WinDir%\Web\Wallpaper\*.jpg, R
;Loop, Files, Z:\_Bilder ALL\2011-06-10 grönemeyer concert aufbau mit hank\*.jpg, R
{
    ; Lädt jedes Bild und fügt es in den Array ein.
    Bilder.Push(LoadPicture(A_LoopFileFullPath))
ToolTip % A_LoopFileFullPath
filesCounter++
}
if !Bilder.Length()
{
    ; Wenn das passiert, müssen Sie den Pfad auf der Loop-Zeile darüber ändern.
    MsgBox, Keine Bilder gefunden!  Probieren Sie ein anderes Verzeichnis aus.
    ExitApp
}
AScreenWidth := (A_ScreenWidth - 400)
AScreenHeight := (A_ScreenHeight - 200)
; Fügt das Picture-Steuerelement hinzu, unter Beibehaltung des Seitenverhältnisses vom ersten Bild.
Gui, Add, Pic, w%AScreenWidth% h%AScreenHeight% vBild +Border, % "HBITMAP:*" Bilder.1
Gui, Add, Text, x20 y10 vText w50
Gui, Show
Loop  % Bilder.Length()
{
    ; Wechselt auf ein anderes Bild!
    GuiControl, , Bild, % "HBITMAP:*" Bilder[Mod(A_Index, Bilder.Length())+1]
CCounter := ("[ " (Mod(A_Index, Bilder.Length())+1) " / " filesCounter " ]")
    GuiControl, , Text, % CCounter
    ToolTip % "HBITMAP:*" Bilder[Mod(A_Index, Bilder.Length())+1] "`n" 
             . filesCounter "`n" 
             . (A_Index, Bilder.Length())+1 "`n" 
             . (Mod(A_Index, Bilder.Length())+1) "`n" 
             . (Mod(A_Index, 12)+1) "`n" 
             . (Mod(1, 12)+1) "`n" 
             . (Mod(2, 12)+1) "`n" 
             . (Mod(3, 12)+1) "`n" 
             . (Mod(11124, 12)+1) "`n" 
             . (Mod(11125, 12)+1) "`n" 
             . (Mod(11126, 12)+1) "`n" 
             . (Mod(11127, 12)+1) "`n" 
             . (Mod(11128, 12)+1) "`n" 
             . (Mod(11129, 12)+1) "`n" 
             . (Mod(345678901, 12)+1) "`n" 
             . (Mod(345678902, 12)+1) "`n" 
             . (Mod(345678903, 12)+1) "`n" 
             . (Mod(345678904, 12)+1) "`n" 
             . (Mod(345678905, 12)+1) "`n" 
             . (Mod(345678906, 12)+1) "`n" 
             . (Mod(345678907, 12)+1) "`n" 
    Sleep 100
;hbm := ("HBITMAP:*" Bilder[Mod(A_Index, Bilder.Length())+1])
hbm := "HBITMAP:*" Bilder.A_Index
bmf := A_ScriptDir "\" (Mod(A_Index, Bilder.Length())+1) ".bmp"
SaveHBITMAPToFile(hbm, bmf)
}
return

SaveHBITMAPToFile(hBitmap, sFile) {
   Static SizeBM := A_PtrSize = 8 ? 32 : 24     ; BITMAP
        , SizeBMFH := 14                        ; BITMAPFILEHEADER
        , SizeBMIH := 40                        ; BITMAPINFOHEADER
        , SizeDIB := A_PtrSize = 8 ? 104 : 84   ; DIBSECTION
   HDIB := DllCall("CopyImage", "Ptr", hBitmap, "UInt", 0, "Int", 0, "Int", 0, "UInt", 0x2000, "UPtr")
   VarSetCapacity(DIB, SizeDIB, 0)
   DllCall("GetObject", "Ptr", HDIB, "Int", SizeDIB, "Ptr", &DIB)
   Size := NumGet(DIB, A_PtrSize = 8 ? 52 : 44, "UInt")
   hFile := FileOpen(sFile, "w", "CP0")
   ; BITMAPFILEHEADER
   hFile.Write("BM")                            ; bfType
   hFile.WriteUInt(SizeBMFH + SizeBMIH + Size)  ; bfSize
   hFile.WriteUInt(0)                           ; bfReserved
   hFile.WriteUInt(SizeBMFH + SizeBMIH)         ; bfOffBits
   ; BITMAPINFOHEADER
   hFile.RawWrite(&DIB + SizeBM, SizeBMIH)
   ; bmBits
   hFile.RawWrite(NumGet(DIB, A_PtrSize = 8 ? 24 : 20, "UPtr"), Size)
   hFile.Close()
   DllCall("DeleteObject", "Ptr", HDIB)
}


GuiClose:
GuiEscape:
ExitApp
nacken012
Posts: 90
Joined: 22 Jul 2016, 14:39

Re: BitMap beschriften

Post by nacken012 » 19 Jul 2021, 00:05

Ich benutze für solche Aufgaben das Dos Tool "Imagick" und die Eingaben von Text usw.. die da rein sollen steuere ich per AHK, lasse dann per start Button eine Batch Datei generieren die dann Imagick mit den nötigen Parametern startet.
just me
Posts: 9424
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: BitMap beschriften

Post by just me » 19 Jul 2021, 04:56

Moin,
effel wrote:Die Zeile GuiControl, , Bild, % "HBITMAP:*" Bilder[Mod(A_Index, Bilder.Length())+1] verleitete mich dazu anzunehmen, das es sich auch um eine gültige 'HBITMAP' Datei handelt.
Da liegst Du auch vollkommen richtig. Jedes Element des Arrays enthält ein HBITMAP Handle, das Du an die Funktion SaveHBITMAPToFile() übergeben kannst. Allerdings darfst Du hier kein "HBITMAP:*" voranstellen. Das bettet den Wert des Handles in eine Zeichenkette ein, die so nur mit AHK-Anweisungen genutzt werden kann.

Code: Select all

   hbm := Bilder.A_Index
   bmf := A_ScriptDir . "\" . A_Index . ".bmp"
   SaveHBITMAPToFile(hbm, bmf)
sollte es tun.
effel
Posts: 542
Joined: 16 Jan 2018, 13:34

Re: BitMap beschriften

Post by effel » 03 Aug 2021, 11:50

Hallo,

ich habe es so umgesetzt, leider werden immer noch nur 'leere' Dateien ohne Bildinhalt gespeichert.

Dabei mache ich sicher nur etwas falsch, aber egal wie oft ich es mir ansehe... :headwall:



Sorry das ich mich jetzt erst melde, meine Tochter ist vom Hochwasser betroffen, das hat meine Prioritäten kurz verlagert.

Code: Select all

loop 12
filedelete,% A_Index ".jpg"

Bilder := []
; Findet einige Bilder zum Anzeigen.
Loop, Files, %A_WinDir%\Web\Wallpaper\*.jpg, R
;Loop, Files, Z:\_Bilder ALL\2011-06-10 grönemeyer concert aufbau mit hank\*.jpg, R
{
    ; Lädt jedes Bild und fügt es in den Array ein.
    Bilder.Push(LoadPicture(A_LoopFileFullPath))
ToolTip % A_LoopFileFullPath
filesCounter++
}

if !Bilder.Length()
{
    ; Wenn das passiert, müssen Sie den Pfad auf der Loop-Zeile darüber ändern.
    MsgBox, Keine Bilder gefunden!  Probieren Sie ein anderes Verzeichnis aus.
    ExitApp
}

AScreenWidth := (A_ScreenWidth - 400)
AScreenHeight := (A_ScreenHeight - 200)
; Fügt das Picture-Steuerelement hinzu, unter Beibehaltung des Seitenverhältnisses vom ersten Bild.
Gui, Add, Pic, w%AScreenWidth% h%AScreenHeight% vBild +Border, % "HBITMAP:*" Bilder.1
Gui, Add, Text, x20 y10 vText w50
Gui, Show

Loop  % Bilder.Length()
{
    ; Wechselt auf ein anderes Bild!
    GuiControl, , Bild, % "HBITMAP:*" Bilder[Mod(A_Index, Bilder.Length())+1]
CCounter := ("[ " (Mod(A_Index, Bilder.Length())+1) " / " filesCounter " ]")
    GuiControl, , Text, % CCounter
    ToolTip % "HBITMAP:*" Bilder[Mod(A_Index, Bilder.Length())+1] "`n" 
             . filesCounter "`n" 
             . (A_Index, Bilder.Length())+1 "`n" 
             . (Mod(A_Index, Bilder.Length())+1) "`n" 
             . (Mod(A_Index, 12)+1) "`n" 
             . (Mod(1, 12)+1) "`n" 
             . (Mod(2, 12)+1) "`n" 
             . (Mod(3, 12)+1) "`n" 
             . (Mod(11124, 12)+1) "`n" 
             . (Mod(11125, 12)+1) "`n" 
             . (Mod(11126, 12)+1) "`n" 
             . (Mod(11127, 12)+1) "`n" 
             . (Mod(11128, 12)+1) "`n" 
             . (Mod(11129, 12)+1) "`n" 
             . (Mod(345678901, 12)+1) "`n" 
             . (Mod(345678902, 12)+1) "`n" 
             . (Mod(345678903, 12)+1) "`n" 
             . (Mod(345678904, 12)+1) "`n" 
             . (Mod(345678905, 12)+1) "`n" 
             . (Mod(345678906, 12)+1) "`n" 
             . (Mod(345678907, 12)+1) "`n" 
    Sleep 100
/*
;hbm := ("HBITMAP:*" Bilder[Mod(A_Index, Bilder.Length())+1])
hbm := Bilder.A_Index
bmf := A_ScriptDir "\" (Mod(A_Index, Bilder.Length())+1) ".bmp"
SaveHBITMAPToFile(hbm, bmf)
*/

 hbm := Bilder.A_Index
;MsgBox % isObject(hbm)
 bmf := A_ScriptDir . "\" . A_Index . ".bmp"
 SaveHBITMAPToFile(hbm, bmf)
}
return

SaveHBITMAPToFile(hBitmap, sFile) {
   Static SizeBM := A_PtrSize = 8 ? 32 : 24     ; BITMAP
        , SizeBMFH := 14                        ; BITMAPFILEHEADER
        , SizeBMIH := 40                        ; BITMAPINFOHEADER
        , SizeDIB := A_PtrSize = 8 ? 104 : 84   ; DIBSECTION
   HDIB := DllCall("CopyImage", "Ptr", hBitmap, "UInt", 0, "Int", 0, "Int", 0, "UInt", 0x2000, "UPtr")
   VarSetCapacity(DIB, SizeDIB, 0)
   DllCall("GetObject", "Ptr", HDIB, "Int", SizeDIB, "Ptr", &DIB)
   Size := NumGet(DIB, A_PtrSize = 8 ? 52 : 44, "UInt")
   hFile := FileOpen(sFile, "w", "CP0")
   ; BITMAPFILEHEADER
   hFile.Write("BM")                            ; bfType
   hFile.WriteUInt(SizeBMFH + SizeBMIH + Size)  ; bfSize
   hFile.WriteUInt(0)                           ; bfReserved
   hFile.WriteUInt(SizeBMFH + SizeBMIH)         ; bfOffBits
   ; BITMAPINFOHEADER
   hFile.RawWrite(&DIB + SizeBM, SizeBMIH)
   ; bmBits
   hFile.RawWrite(NumGet(DIB, A_PtrSize = 8 ? 24 : 20, "UPtr"), Size)
   hFile.Close()
   DllCall("DeleteObject", "Ptr", HDIB)
}


GuiClose:
GuiEscape:
ExitApp
effel
Posts: 542
Joined: 16 Jan 2018, 13:34

Re: BitMap beschriften

Post by effel » 03 Aug 2021, 12:15

Nachtrag:

Mit hbm := Bilder[A_Index] geht es besser, aber es werden nur 2 von 12 Dateien korrekt abgespeichert

Unbenannt.png
(11.37 KiB) Downloaded 287 times
effel
Posts: 542
Joined: 16 Jan 2018, 13:34

Re: BitMap beschriften

Post by effel » 03 Aug 2021, 17:20

Ohne Loop bekomme ich das gewünschte Ergebnis.

Code: Select all

Bilder := []
; Findet einige Bilder zum Anzeigen.
Loop, Files, %A_WinDir%\Web\Wallpaper\*.jpg, R
{
    ; Lädt jedes Bild und fügt es in den Array ein.
    Bilder.Push(LoadPicture(A_LoopFileFullPath))
ToolTip % A_LoopFileFullPath
}

SaveHBITMAPToFile(Bilder.1, (A_ScriptDir "\1a.bmp"))
SaveHBITMAPToFile(Bilder.2, (A_ScriptDir "\2a.bmp"))
SaveHBITMAPToFile(Bilder.3, (A_ScriptDir "\3a.bmp"))
SaveHBITMAPToFile(Bilder.4, (A_ScriptDir "\4a.bmp"))
SaveHBITMAPToFile(Bilder.5, (A_ScriptDir "\5a.bmp"))
SaveHBITMAPToFile(Bilder.6, (A_ScriptDir "\6a.bmp"))
SaveHBITMAPToFile(Bilder.7, (A_ScriptDir "\7a.bmp"))
SaveHBITMAPToFile(Bilder.8, (A_ScriptDir "\8a.bmp"))
SaveHBITMAPToFile(Bilder.9, (A_ScriptDir "\9a.bmp"))
SaveHBITMAPToFile(Bilder.10, (A_ScriptDir "\10a.bmp"))
SaveHBITMAPToFile(Bilder.11, (A_ScriptDir "\11a.bmp"))
SaveHBITMAPToFile(Bilder.12, (A_ScriptDir "\12a.bmp"))

   GDIP("Startup")
SavePicture(Bilder.1, (A_ScriptDir "\1b.bmp"))
SavePicture(Bilder.2, (A_ScriptDir "\2b.bmp"))
SavePicture(Bilder.3, (A_ScriptDir "\3b.bmp"))
SavePicture(Bilder.4, (A_ScriptDir "\4b.bmp"))
SavePicture(Bilder.5, (A_ScriptDir "\5b.bmp"))
SavePicture(Bilder.6, (A_ScriptDir "\6b.bmp"))
SavePicture(Bilder.7, (A_ScriptDir "\7b.bmp"))
SavePicture(Bilder.8, (A_ScriptDir "\8b.bmp"))
SavePicture(Bilder.9, (A_ScriptDir "\9b.bmp"))
SavePicture(Bilder.10, (A_ScriptDir "\10b.bmp"))
SavePicture(Bilder.11, (A_ScriptDir "\11b.bmp"))
SavePicture(Bilder.12, (A_ScriptDir "\12b.bmp"))
   GDIP("Shutdown")
return

SaveHBITMAPToFile(hBitmap, sFile) {
   Static SizeBM := A_PtrSize = 8 ? 32 : 24     ; BITMAP
        , SizeBMFH := 14                        ; BITMAPFILEHEADER
        , SizeBMIH := 40                        ; BITMAPINFOHEADER
        , SizeDIB := A_PtrSize = 8 ? 104 : 84   ; DIBSECTION
   HDIB := DllCall("CopyImage", "Ptr", hBitmap, "UInt", 0, "Int", 0, "Int", 0, "UInt", 0x2000, "UPtr")
   VarSetCapacity(DIB, SizeDIB, 0)
   DllCall("GetObject", "Ptr", HDIB, "Int", SizeDIB, "Ptr", &DIB)
   Size := NumGet(DIB, A_PtrSize = 8 ? 52 : 44, "UInt")
   hFile := FileOpen(sFile, "w", "CP0")
   ; BITMAPFILEHEADER
   hFile.Write("BM")                            ; bfType
   hFile.WriteUInt(SizeBMFH + SizeBMIH + Size)  ; bfSize
   hFile.WriteUInt(0)                           ; bfReserved
   hFile.WriteUInt(SizeBMFH + SizeBMIH)         ; bfOffBits
   ; BITMAPINFOHEADER
   hFile.RawWrite(&DIB + SizeBM, SizeBMIH)
   ; bmBits
   hFile.RawWrite(NumGet(DIB, A_PtrSize = 8 ? 24 : 20, "UPtr"), Size)
   hFile.Close()
   DllCall("DeleteObject", "Ptr", HDIB)
}

SavePicture(hBM, sFile) {                                            ; By SKAN on D293 @ bit.ly/2krOIc9
Local V,  pBM := VarSetCapacity(V,16,0)>>8,  Ext := LTrim(SubStr(sFile,-3),"."),  E := [0,0,0,0]
Local Enc := 0x557CF400 | Round({"bmp":0, "jpg":1,"jpeg":1,"gif":2,"tif":5,"tiff":5,"png":6}[Ext])
  E[1] := DllCall("gdi32\GetObjectType", "Ptr",hBM ) <> 7
  E[2] := E[1] ? 0 : DllCall("gdiplus\GdipCreateBitmapFromHBITMAP", "Ptr",hBM, "UInt",0, "PtrP",pBM)
  NumPut(0x2EF31EF8,NumPut(0x0000739A,NumPut(0x11D31A04,NumPut(Enc+0,V,"UInt"),"UInt"),"UInt"),"UInt")
  E[3] := pBM ? DllCall("gdiplus\GdipSaveImageToFile", "Ptr",pBM, "WStr",sFile, "Ptr",&V, "UInt",0) : 1
  E[4] := pBM ? DllCall("gdiplus\GdipDisposeImage", "Ptr",pBM) : 1
Return E[1] ? 0 : E[2] ? -1 : E[3] ? -2 : E[4] ? -3 : 1  
}

GDIP(C:="Startup") {                                      ; By SKAN on D293 @ bit.ly/2krOIc9
  Static SI:=Chr(!(VarSetCapacity(Si,24,0)>>16)), pToken:=0, hMod:=0, Res:=0, AOK:=0
  If (AOK := (C="Startup" and pToken=0) Or (C<>"Startup" and pToken<>0))  {
      If (C="Startup") {
               hMod := DllCall("LoadLibrary", "Str","gdiplus.dll", "Ptr")
               Res  := DllCall("gdiplus\GdiplusStartup", "PtrP",pToken, "Ptr",&SI, "UInt",0)
      } Else { 
               Res  := DllCall("gdiplus\GdiplusShutdown", "Ptr",pToken)
               DllCall("FreeLibrary", "Ptr",hMod),   hMod:=0,   pToken:=0
   }}  
Return (AOK ? !Res : Res:=0)    
}

GuiClose:
GuiEscape:
ExitApp
just me
Posts: 9424
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: BitMap beschriften

Post by just me » 04 Aug 2021, 07:09

Moin,

Du machst in Deinem Skript von gestern ein paar Sachen, die sich mir noch nicht erschließen. Siehst Du 12 verschiedene Bilder im Pic-Control?

P.S.: Alles Gute für Deine Tochter!
effel
Posts: 542
Joined: 16 Jan 2018, 13:34

Re: BitMap beschriften

Post by effel » 04 Aug 2021, 14:23

Hallo,

ja ich sehe 12 verschiedene Bilder [Win 10]

Das Script verhält sich seltsam. Einmal funktioniert der Aufruf einwandfrei, alle 12 Bilder werden kopiert.

Um sicher zu sein, das keine Prozesse aktiv sind, kille ich vor dem erneuten Aufruf alle AHK Prozesse

Dann lösche ich die erstellten Bilder und bei einem weiteren Aufruf werden nur 3 oder keine Bilder kopiert.

Es werden aber immer mindestens die leeren Dateien mit 54 Bytes angelegt.
das_Dreckige_Dutzend.jpg
(247.33 KiB) Downloaded 178 times

Re: P.S.: Danke. Sie hatten nur Sachschaden. Nachbarn hatten zum Teil weniger Glück.
just me
Posts: 9424
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: BitMap beschriften

Post by just me » 05 Aug 2021, 03:07

Moin,

BMP-Dateien mit einer Länge von 54 Byte bestehen nur aus dem Header und enthalten keine Pixeldaten. Wie das ensteht, ist mir nicht klar. Man kann allerdings ausschließen, dass das mit der Art der Insizierung Bilder[A_Index] / Bilder.1 zusammenhängt.

Lass doch bitte mal die folgende Version von SaveHBITMAPToFile() laufen.

Code: Select all

SaveHBITMAPToFile(hBitmap, sFile) {
   Static SizeBM := A_PtrSize = 8 ? 32 : 24     ; BITMAP
        , SizeBMFH := 14                        ; BITMAPFILEHEADER
        , SizeBMIH := 40                        ; BITMAPINFOHEADER
        , SizeDIB := A_PtrSize = 8 ? 104 : 84   ; DIBSECTION
   HDIB := DllCall("CopyImage", "Ptr", hBitmap, "UInt", 0, "Int", 0, "Int", 0, "UInt", 0x2000, "UPtr")
   VarSetCapacity(DIB, SizeDIB, 0)
   DllCall("GetObject", "Ptr", HDIB, "Int", SizeDIB, "Ptr", &DIB)
   MsgBox, % "HBITMAP: " . hBitmap . "`n"
           . "File: " . sFile . "`n"
           . "Size: " . NumGet(DIB, A_PtrSize = 8 ? 52 : 44, "UInt") . "`n"
           . "Bits: " . NumGet(DIB, A_PtrSize = 8 ? 24 : 20, "UPtr"
   Size := NumGet(DIB, A_PtrSize = 8 ? 52 : 44, "UInt")
   hFile := FileOpen(sFile, "w", "CP0")
   ; BITMAPFILEHEADER
   hFile.Write("BM")                            ; bfType
   hFile.WriteUInt(SizeBMFH + SizeBMIH + Size)  ; bfSize
   hFile.WriteUInt(0)                           ; bfReserved
   hFile.WriteUInt(SizeBMFH + SizeBMIH)         ; bfOffBits
   ; BITMAPINFOHEADER
   hFile.RawWrite(&DIB + SizeBM, SizeBMIH)
   ; bmBits
   hFile.RawWrite(NumGet(DIB, A_PtrSize = 8 ? 24 : 20, "UPtr"), Size)
   hFile.Close()
   DllCall("DeleteObject", "Ptr", HDIB)
}
Was sagt sie Dir?
effel
Posts: 542
Joined: 16 Jan 2018, 13:34

Re: BitMap beschriften

Post by effel » 05 Aug 2021, 15:46

just me wrote:
05 Aug 2021, 03:07
Was sagt sie Dir?
das es an meinem Rechner lag, Ich hatte nicht genug Platz auf der Platte.

Danke für deine Mühen

Unbenannt_#3.png
(12.12 KiB) Downloaded 96 times
P.S.: MsgBox, % "HBITMAP: " . hBitmap . "`n"
. "File: " . sFile . "`n"
. "Size: " . NumGet(DIB, A_PtrSize = 8 ? 52 : 44, "UInt") . "`n"
. "Bits: " . NumGet(DIB, A_PtrSize = 8 ? 24 : 20, "UPtr")

falls das jemand nutzen möchte...
Post Reply

Return to “Ich brauche Hilfe”