Hi Martin,
ich habe inzwischen das Projekt, verstehe aber .NET noch nicht.
Ich habe das Projekt in VB6 nachgebaut, da ist das nicht viel, aber schnell. Kannst Du das nach VB.NET umschreiben?
Gruß Rainer
Option Explicit
Private Type BITMAP
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Private Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
Private Declare Function SetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
Dim PicBits() As Byte, PicInfo As BITMAP
Dim Cnt As Long, BytesPerLine As Long
Private Sub Command2\_Click()
Dim tm As Long
tm = Timer
GetObject Picture1.Image, Len(PicInfo), PicInfo
BytesPerLine = (PicInfo.bmWidth \* 3 + 3) And &HFFFFFFFC
ReDim PicBits(1 To BytesPerLine \* PicInfo.bmHeight \* 3) As Byte
GetBitmapBits Picture1.Image, UBound(PicBits), PicBits(1)
'Auswertung
For Cnt = 1 To UBound(PicBits) Step 4
If PicBits(Cnt) \> 100 Then
PicBits(Cnt) = 255
PicBits(Cnt + 1) = 255
PicBits(Cnt + 2) = 255
End If
Next Cnt
SetBitmapBits Picture1.Image, UBound(PicBits), PicBits(1)
Picture1.Refresh
Me.Caption = Round(Timer - tm, 2)
End Sub
Private Sub Command1\_Click()
CommonDialog1.ShowOpen
Picture1.Picture = LoadPicture(CommonDialog1.FileName)
End Sub
Private Sub Command3\_Click()
CommonDialog1.ShowSave
SavePicture Picture1.Image, CommonDialog1.FileName
End Sub
Private Sub Form\_Load()
Picture1.AutoSize = True
Picture1.AutoRedraw = True
Command1.Caption = "laden"
Command2.Caption = "bearbeiten"
Command3.Caption = "sichern"
End Sub