ImageExtensionsToBitmapSource Method (Image, Int32, Int32, Rect, PlaneConfiguration, Double, Int32, HighBitScaleMode)

CVB.Net Documentation
Create a BitmapSource from this CVB image.

Namespace:  Stemmer.Cvb.Wpf
Assembly:  Stemmer.Cvb.Wpf (in Stemmer.Cvb.Wpf.dll) Version: 14.0.0.0
Syntax

public static BitmapSource ToBitmapSource(
	this Image img,
	int width,
	int height,
	Rect sourceRect,
	PlaneConfiguration planes,
	double gain,
	int offset,
	HighBitScaleMode mode
)

Parameters

img
Type: Stemmer.CvbImage
the Image to work on
width
Type: SystemInt32
width of the Bitmap to be returned; may be 0, in which case the width is calculated taking into account the aspect ration of sourceRect (if height != 0) or will be set to the width of sourceRect (if width and height are 0)
height
Type: SystemInt32
height of the Bitmap to be returned; may be 0, in which case the height is calculated taking into account the aspect ration of sourceRect (if width != 0) or will be set to the height of sourceRect (if width and height are 0)
sourceRect
Type: Stemmer.CvbRect
subregion of the image to paint into the bmData
planes
Type: Stemmer.CvbPlaneConfiguration
plane configuration to use for painting
gain
Type: SystemDouble
gain to apply during painting
offset
Type: SystemInt32
offset to apply during painting
mode
Type: Stemmer.CvbHighBitScaleMode
treatment for images with more than 8 bits per pixel

Return Value

Type: BitmapSource
newly created bmData source

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Image. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions

ExceptionCondition
ObjectDisposedExceptionIf this image has already been disposed
See Also

Reference