Create new Zone within image
- left
- top
- right
- bottom
The zone's rectangle object should have valid coordinates (right greater than left and bottom greater than top); otherwise the zone is considered empty (object.Zone.IsEmpty returns True.) Invocation of ClearImage methods with an empty zone will generate an error.
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.
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 |
CiImage Object | CiImage Members | CreateZone | CreateZoneRect | IsZone | Zone | Parent