The workspace object is the container that is used to manage changes to images and provide an interface to open, save, and manipulate images either synchronously or asynchronously.
Thetype exposes the following members.
Gets or sets a value indicating if method calls through this Workspace object are processed asynchronously in a background thread.
Gets or sets a value indicating if the Workspace should dispose all images it contains when finalized.
Gets or sets the current AtalaImage that is active in this Workspace.
Gets the ImageCollection of this Workspace object.
Gets the ProcessQueue containing queued items that this Workspace object is currently processing.
Gets the UndoCollection object containing the undo history of this Workspace.
Applies an ImageCommand to the current image in order to process it.
Creates an undo level, then applies an ImageCommand to the current image in order to process it.
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.)
Releases unmanaged and - optionally - managed resources.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Finalizes an instance of the Workspace class.(Overrides ObjectFinalize.)
Serves as the default hash function.(Inherited from Object.)
Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.)
Gets the Type of the current instance.(Inherited from Object.)
Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.)
Creates a shallow copy of the current Object.(Inherited from Object.)
Creates a shallow copy of the current MarshalByRefObject object.(Inherited from MarshalByRefObject.)
Invoked when pixel data in the current image changes without setting a new image. Fires the DisposeImage event.
Invoked after an image has been read or saved signifying that the Stream which was passed in can be closed. Fires the ImageStreamCompleted event.
Invoked when an asynchronous process has completed. Fires the ProcessCompleted event.
Invoked when an error occurs in a separate thread when being processed asynchronously. Fires the ProcessError event.
Decodes an image from a stream and sets it to the current image.
Decodes an image from a file and sets it to the current image.
Decodes an image from a stream specifying the frame index of a multipaged file, and sets it to the current image.
Decodes an image from a file specifying the frame index of a multipaged file, and sets it to the current image.
|Save(Stream, ImageEncoder, Int32)|
|Save(String, ImageEncoder, Int32)|
Writes the current %AtalaImage% or %ImageCollection% to a file specifying the ImageEncoder to use to encode the image and the image index in the collection to save.
Returns a string that represents the current object.(Inherited from Object.)
Fired when an image in the ImageCollection or UndoCollection is disposed.
Occurs when the current image in the ImageCollection changes.
Fires after an image has been read or saved signifying that the Stream which was passed in can be closed.
Fires when an asynchronous process has completed.
Fires when an error occurs in a separate thread when being processed asynchronously.
Fires while an image is being processed.
The Workspace object, part of the Atalasoft.Imaging namespace, provides a container that allows for intuitive image processing and management of AtalaImage and ImageCollection objects. The Workspace can be used to manage changes to AtalaImage objects and access methods to open, save, and manipulate images.
Many image processing functions may create new AtalaImage objects. The Workspace manages the creation of these objects by keeping a single current image and providing events when the image changes. The Workspace also disposes of old images when they are no longer needed. You can access the current AtalaImage with the Image property of the Workspace object.
The Workspace is designed to operate either synchronously or asynchronously for multi-threading operations. This behavior is set by the Asynchronous property.
See the WinForm's WorkspaceViewer for a Workspace object with a user interface for displaying images.
This example demonstrates how to create a new workspace, open an image, resample it, then save it to a file.
Workspace myWorkspace = new Workspace(); myWorkspace.Open("image.png"); myWorkspace.ApplyCommand(new ResampleCommand((int)(myWorkspace.Width / 2), (int)(myWorkspace.Height / 2))); myWorkspace.Save("newImage.png", new PngEncoder()); myWorkspace.Dispose();
Dim myWorkspace As Workspace = New Workspace() myWorkspace.Open("image.png") myWorkspace.ApplyCommand(New ResampleCommand(myWorkspace.Width / 2, myWorkspace.Height / 2)) myWorkspace.Save("newImage.png", New PngEncoder()) myWorkspace.Dispose()