狐表没有这方面图像处理帮助。
参考下下面代码自己改改,不过注意背景必须是纯白色(255,255,255),不然处理不了
Dim pic As WinForm.PictureBox = e.Form.Controls("PictureBox1")
try
Dim SourceBitmap As Bitmap = pic.Image
Dim ForOutBitmap As new Bitmap(SourceBitmap)
Dim bmpDATA = new Imaging.BitmapData()
bmpDATA = ForOutBitmap.LockBits(new Rectangle(0, 0, SourceBitmap.Width - 1, SourceBitmap.Height - 1), Imaging.ImageLockMode.ReadOnly, Imaging.PixelFormat.Format32bppArgb)
Dim BTS(bmpDATA.Stride * bmpDATA.Height + 1) As Byte
System.Runtime.InteropServices.Marshal.Copy(bmpDATA.Scan0, BTS, 0, BTS.Length - 1)
Dim tmpValue As Byte
For i As Integer = 0 To BTS.Length - 4 Step 4
If BTS(i) = 255 And BTS(I + 1) = 255 And BTS(I + 2) = 255
BTS(I + 3) = tmpValue
End If
Next
System.Runtime.InteropServices.Marshal.Copy(BTS, 0, bmpDATA.Scan0, BTS.Length - 1)
ForOutBitmap.UnlockBits(bmpDATA)
pic.Image = ForOutBitmap
catch ex As Exception
msgbox(ex.message)
End try