GetShapePicturePixels example
Example for GetShapePicturePixels method
Dim avHandle As Integer
Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
Call CAvax1.StartAvax()
Call AddPicture()
End Sub
Private Sub Form1_FormClosed(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
Call cAvax1.EndAvax()
End Sub
Sub AddPicture()
Dim sPictureFiles() As String
Dim xMin As Single
Dim yMin As Single
Dim xMax As Single
Dim yMax As Single
ReDim sPictureFiles(1)
sPictureFiles(1) = My.Application.Info.DirectoryPath & "\..\Clouds1.bmp"
xMin = 0
yMin = 0
xMax = 5
yMax = 5
avHandle = CAvax1.Add_Picture(sPictureFiles, xMin, yMin, xMax, yMax)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim lWidth As Integer
Dim lHeight As Integer
Dim RGBPixels(,) As Integer
Dim Answer As Boolean
Dim pixelsCount As Integer
Answer = CAvax1.GetShapePicturePixels(avHandle, lWidth, lHeight, RGBPixels)
If Answer = True Then
pixelsCount = (RGBPixels.GetLength(0) - 1) * (RGBPixels.GetLength(1) - 1)
MsgBox("Width=" & lWidth & Environment.NewLine & "Height=" & lHeight & Environment.NewLine & "Pixels count=" & pixelsCount)
End If
End Sub