FreeImageBitmap.CreateView Method

FreeImage.NET

FreeImageBitmapCreateView Method
Creates a dynamic read/write view into a FreeImage bitmap.

Namespace: FreeImageAPI
Assembly: FreeImageNET (in FreeImageNET.dll) Version: 3.17.0.4 (3.17.0)
Syntax
C#
public FreeImageBitmap CreateView(
	int left,
	int top,
	int right,
	int bottom
)

Parameters

left
Type: SystemInt32
The left position of the view's area.
top
Type: SystemInt32
The top position of the view's area.
right
Type: SystemInt32
The right position of the view's area.
bottom
Type: SystemInt32
The bottom position of the view's area.

Return Value

Type: FreeImageBitmap
The newly created view or null if the view was not created.
Remarks

A dynamic view is a FreeImage bitmap with its own width and height, that, however, shares its bits with another FreeImage bitmap. Typically, views are used to define one or more rectangular sub-images of an existing bitmap. All FreeImage operations, like saving, displaying and all the toolkit functions, when applied to the view, only affect the view's rectangular area.

Only the backing image's pixels are shared by the view. For all other image data, notably for the resolution, background color, color palette, transparency table and for the ICC profile, the view gets a private copy of the data. By default, the backing image's metadata is NOT copied to the view.

As with all FreeImage functions that take a rectangle region, top and left positions are included, whereas right and bottom positions are excluded from the rectangle area. Since the memory block shared by the backing image and the view must start at a byte boundary, the value of parameter left must be a multiple of 8 for 1-bit images and a multiple of 2 for 4-bit images.

See Also