Core Optical, Inc.
SourceData GetBitmapSource Method Industrial Strength, Scientific Grade
Gets a OnlineBitmapSource representation of the data using the original source PixelFormat and specified range output windowing.

Namespace: PrecisionImage
Assembly: PrecisionImage (in PrecisionImage.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax

public BitmapSource GetBitmapSource(
	OutputWindowing outputWindowing = null,
	GammaEncoding gammaEncoding = GammaEncoding.sRGB,
	Int32Rect regionOfInterest = null,
	float fixedAlphaValue = -1f
)

Parameters

outputWindowing (Optional)
Type: PrecisionImage.Visualization OutputWindowing
An OutputWindowing object that specifies channel-specific leveling. This parameter is optional and defaults to autoleveling each channel to its individual min/max values.
gammaEncoding (Optional)
Type: PrecisionImage GammaEncoding
A GammaEncoding enumeration indicating whether or not to gamma encode the output image. This parameter is optional and defaults to GammaEncoding.sRGB.
regionOfInterest (Optional)
Type: OnlineSystem.Windows Int32Rect
An OnlineInt32Rect type indicating the region of interest to render. This parameter is optional and defaults to the entire image.
fixedAlphaValue (Optional)
Type: OnlineSystem Single
A OnlineSingle type that indicates a fixed value for the alpha channel of the output image. Value must be between 0 and 1.

Return Value

A OnlineBitmapSource object containing the image of the data.
Exceptions

ExceptionCondition
OnlineSystem ArgumentOutOfRangeException Thrown when regionOfInterest specifies a rectangular region not completely contained within the dimensions of the source data.
OnlineSystem ArgumentException Thrown when no output OnlinePixelFormat is currently associated with the SourceData object.
Remarks

Use this method to retrieve a OnlineBitmapSource representation of the data using the object's current OnlinePixelFormat. The object's current OnlinePixelFormat can be assigned using the AssignOutputPixelFormat(PixelFormat) method. The outputWindowing parameter controls the visual scaling of the individual data channels. If no output window is associated with a particular channel the method defaults to the standard data range (0.0 - 1.0) for that channel.

See AssignOutputPixelFormat(PixelFormat) for associating an output OnlinePixelFormat with the current SourceData object. See the RedChannelIndex, GreenChannelIndex, BlueChannelIndex and AlphaChannelIndex properties for assigning data channels. If no pixel format is currently with the SourceData object then an 8-bit grayscale depiction of the data in channel 0 is returned by default.

To generate an image incorporating a particular alpha value, use AssignOutputPixelFormat(PixelFormat) to assign an alpha-enabled output pixel format, and (optionally) specify the magnitude of the alpha value to use via the fixedAlphaValue argument. The alpha value must be a value between 0 and 1, and will default to 1 if no value is specified. Specifying a fixed alpha value without also assigning an alpha-enabled output pixel type will not cause an alpha-enabled image to be produced (both arguments must be satisfied).

If the the current OnlinePixelFormat is a grey-scale type format, the data for the image is automatically sourced from channel 0. To retrieve a grayscale image from another channel in the SourceData object, use one of the SourceData.GetChannelImage methods.

See Also