Form1.vb
上传用户:ammar_low
上传日期:2021-11-27
资源大小:44k
文件大小:1k
- Imports System
- Imports System.Runtime.InteropServices
- Imports System.Drawing.Imaging
- Public Class Form1
- Declare Function ConvertColor_Inverse Lib "ImageProcess.dll" (ByVal ptrSrc As IntPtr, ByVal ImageWidth As Integer, ByVal ImageHeight As Integer, ByVal ptrDest As IntPtr) As Boolean
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If Me.OpenFileDialog1.ShowDialog() <> Windows.Forms.DialogResult.OK Then
- Return
- End If
- Dim bmpSrc As Bitmap = New Bitmap(Me.OpenFileDialog1.FileName)
- Me.PictureBox1.Image = bmpSrc
- PictureBox1.Refresh()
- MessageBox.Show("asdf")
- Dim bmpdata As BitmapData = bmpSrc.LockBits(New Rectangle(0, 0, bmpSrc.Width, bmpSrc.Height), ImageLockMode.ReadWrite, bmpSrc.PixelFormat)
- ConvertColor_Inverse(bmpdata.Scan0, bmpdata.Stride, bmpdata.Height, bmpdata.Scan0)
- bmpSrc.UnlockBits(bmpdata)
- Me.PictureBox1.Image = bmpSrc
- End Sub
- End Class