I use ImageToArray function to extract a pixel array from an image. And I want to copy this array to the portion of the other image. I wrote a program as follow, but it dosen't work? Did anybody can help me.
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
Private Sub Test_Click()
Dim pixelArray1 As Variant
Dim testarray() As Variant
Dim filename As String
Dim image1 As New CWIMAQImage
Dim h As Integer,w As Integer
ChDrive App.Path
ChDir App.Path
filename = CurDir & "\\test.png"
CWIMAQViewer1.Palette = cwimaqPaletteBinary
CWIMAQVision1.ReadImage image1, filename
ReDim testarray(5000, 5000)
h=
image1.Height
w=image1.Width
pixelArray1 = image1.ImageToArray
CopyMemory testarray(1000,1000),pixelArray1,h*w*16
End Sub