ImageGear for .NET
SeparateChannels Method
Example 




Multichannel page to separate.
Creates an array of pages, where each page contains one channel with color space set to grayscale.
Syntax
'Declaration
 
Public Shared Function SeparateChannels( _
   ByVal page As ImGearRasterPage _
) As ImGearChannelRef()
'Usage
 
Dim page As ImGearRasterPage
Dim value() As ImGearChannelRef
 
value = ImGearRasterProcessing.SeparateChannels(page)
public static ImGearChannelRef[] SeparateChannels( 
   ImGearRasterPage page
)
public: static ImGearChannelRef[]* SeparateChannels( 
   ImGearRasterPage* page
) 
public:
static array<ImGearChannelRef>^ SeparateChannels( 
   ImGearRasterPage^ page
) 

Parameters

page
Multichannel page to separate.

Return Value

An array of channels reference - ImGearChannelRef structure.
Remarks
This method does not do any of the color space or pixel conversions.
Example
// Separate original image into separate images for each channel.
ImGearChannelRef[] igChannelRefOriginal = ImGearRasterProcessing.SeparateChannels(igRasterPage);
// Save what the colorspace was of the image.
ImGearColorSpaceIDs igColorSpaceID = igRasterPage.DIB.ColorSpace.Value;
// Create a blank image with the same attributes as the original image.
ImGearRasterPage igRasterPageNew = new ImGearRasterPage(
    igRasterPage.DIB.Width, igRasterPage.DIB.Height,
    new ImGearColorSpace(igColorSpaceID),
    (int[])igRasterPage.DIB.ChannelDepths.Clone(), true);
// Separate new image into separate images for each channel.
ImGearChannelRef[] igChannelRefNew = ImGearRasterProcessing.SeparateChannels(igRasterPageNew);
// Update the first channel of the new image from the original image.
ImGearRasterProcessing.UpdateChannelFrom(igChannelRefNew[0], igChannelRefOriginal[0]);
// Combine channels back into new image.
igRasterPageNew = ImGearRasterProcessing.CombineChannels(
    new ImGearColorSpace(igColorSpaceID), igChannelRefNew);
' Separate original image into separate images for each channel.
Dim igChannelRefOriginal As ImGearChannelRef() = ImGearRasterProcessing.SeparateChannels(igRasterPage)
' Save what the colorspace was of the image.
Dim igColorSpaceID As ImGearColorSpaceIDs = igRasterPage.DIB.ColorSpace.Value
' Create a blank image with the same attributes as the original image.
Dim igRasterPageNew As New ImGearRasterPage( _
 igRasterPage.DIB.Width, igRasterPage.DIB.Height, New ImGearColorSpace(igColorSpaceID), _
 DirectCast(igRasterPage.DIB.ChannelDepths.Clone(), Integer()), True)
' Separate new image into separate images for each channel.
Dim igChannelRefNew As ImGearChannelRef() = ImGearRasterProcessing.SeparateChannels(igRasterPageNew)
' Update the first channel of the new image from the original image.
ImGearRasterProcessing.UpdateChannelFrom(igChannelRefNew(0), igChannelRefOriginal(0))
' Combine channels back into new image.
igRasterPageNew = ImGearRasterProcessing.CombineChannels(New ImGearColorSpace(igColorSpaceID), igChannelRefNew)
See Also

Reference

ImGearRasterProcessing Class
ImGearRasterProcessing Members
ImGearChannelRef Structure
ImGearRasterPage Class

 

 


©2014. Accusoft Corporation. All Rights Reserved.

Send Feedback