'Sample usage of Perspective function.
Dim igPointLeftTop As ImGearPoint, igPointRightTop As ImGearPoint
Dim igPointLeftBottom As ImGearPoint, igPointRightBottom As ImGearPoint
'New positions for the 4 corners of the image
igPointLeftTop = New ImGearPoint(igRasterPage.DIB.Width / 4, igRasterPage.DIB.Height / 4)
igPointRightTop = New ImGearPoint(igRasterPage.DIB.Width, 0)
igPointLeftBottom = New ImGearPoint(0, igRasterPage.DIB.Height)
igPointRightBottom = New ImGearPoint(3 * igRasterPage.DIB.Width / 4, 3 * igRasterPage.DIB.Height / 4)
'Background color to fill in after adjusting the corners of the image.
Dim igPixel As New ImGearPixel(igRasterPage.DIB.ChannelCount, igRasterPage.DIB.BitsPerChannel)
For i As Integer = 0 To igPixel.ChannelCount - 1
igPixel(i) = CInt(Math.Pow(2, igRasterPage.DIB.BitsPerChannel)) / 4
Next
'Set the color to a dark gray based on the bits per channel.
'Apply the perspective change.
ImGearEffects.Perspective(igRasterPage, igPointLeftTop, igPointRightTop, _
igPointLeftBottom, igPointRightBottom, igPixel)