ClearImage COM Server
CreateZoneRect Method
See Also  Example  Send Feedback
Rect
CiImage Object : CreateZoneRect Method

Description

Create new Zone within image

Syntax

Visual Basic
Public Function CreateZoneRect( _
   ByVal Rect As CiRect _
) As CiImage

Parameters

Rect

Remarks

Coordinates are inclusive, meaning pixels belonging to left and top row, top and bottom columns belong to a zone.
Minimum width and height of zone are 2 pixels. 

Example

VB Example (Visual Basic)Copy Code
Public Sub T_Zone(ByRef Img As CiImage)
    ' Create zone on image
  Dim ImgZone As CiImage, ImgZone1 As CiImage
    ' Create zone
  Set ImgZone = Img.CreateZone(Img.Width / 3, Img.Height / 3, _
                               Img.Width * 2 / 3, Img.Height * 2 / 3)
    ' Inverts zo1ne
  ImgZone.Invert
    ' Use CreateZoneRect to create another zone
  Set ImgZone1 = Img.CreateZoneRect(ImgZone.Zone)
    ' Use Zone property to expand zone
  ImgZone1.Zone.left = ImgZone1.Zone.left - 100
  ImgZone1.Zone.right = ImgZone1.Zone.right + 100
  ImgZone1.Zone.top = ImgZone1.Zone.top - 50
  ImgZone1.Zone.bottom = ImgZone1.Zone.bottom + 50
    ' Inverts expanded zone
  ImgZone1.Invert
    ' Use IsZone property
  Debug.Print "Img is '" & IIf(Img.IsZone, "zone", "image") & "' object"
  Debug.Print "ImgZone1 is '" & IIf(ImgZone1.IsZone, "zone", "image") & "' object"
    ' Use Parent property
  If (Not ImgZone1.Parent.IsZone) Then
    ImgZone1.Parent.Invert
  End If
End Sub

See Also

© 1992-2011. Inlite Research, Inc. All Rights Reserved.