Declare Function
02.05.2023 12:36:25
Frank
Guten Tag ans Forum,
kann mir bitte jemand sagen wie ich oben die Functions definieren muss, dass sie in Excel 64 bit verwendet werden können? Ich habe den Code hier gefunden: https://www.vbarchiv.net/api/api_setpixel.html
Private Declare Function GetPixel Lib "gdi32.dll" ( _
ByVal hdc As Long, _
ByVal nXPos As Long, _
ByVal nYPos As Long) As Long
Private Declare Function SetPixel Lib "gdi32.dll" ( _
ByVal hdc As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal crColor As Long) As Long
' Plazieren Sie ein Bildfeld (Picture1) auf die Form und ordnen diesem
' ein beliebiges Bild zu
Private Sub Command1_Click()
Dim I, J As Long
With Picture1
.ScaleMode = vbPixels
' Invertiert eine Grafik
For I = 0 To .ScaleWidth
For J = 0 To .ScaleHeight
SetPixel .hdc, I, J, GetPixel(.hdc, I, J) Xor -1
Next J
Next I
End With
End Sub
Vielen Dank
Frank