ClearImage COM API
ExtractObject Method
CiTools Object : ExtractObject Method
a CiObject object returned by FirstObject or NextObject methods
Description
Extract an object into a new image
Syntax
Visual Basic
Public Function ExtractObject( _
   ByVal Object As CiObject _
) As CiImage
Parameters
Object
a CiObject object returned by FirstObject or NextObject methods
Return Type
An image of the size of Object.Rect containing all pixels of Object
Remarks
Method requires bi-tonal image (object.Image.BitsPerPixel = 1).
Example
Extract all objects into individual images
Sub ExtractObjects(imageFile As String)
      ' Open image file
    Dim ci As New CiServer
    Dim Tools As CiTools: Set Tools = ci.CreateTools
    Tools.Image.Open imageFile
      ' Do processing
    Dim Obj As CiObject
    Dim imageObject As CiImage   '  Image of extracted object
    Set Obj = Tools.FirstObject
    Do While Not Obj Is Nothing
      Set imageObject = Tools.ExtractObject(Obj)
      ' Do something with imageObject  For Example:
      '  imageObject.Append outFile
      Set Obj = Tools.NextObject
    Loop
End Sub
See Also

CiTools Object  | CiTools Members  | NextObject  | ExtractObject  | FirstObject  | CiObject