ImageGear .NET v25.1 - Updated
Merge(ImGearRasterPage,ImGearRasterPage,Int32,Int32,ImGearMergeModes) Method
Example 




ImageGear.Core Assembly > ImageGear.Processing Namespace > ImGearRasterProcessing Class > Merge Method : Merge(ImGearRasterPage,ImGearRasterPage,Int32,Int32,ImGearMergeModes) Method
First image to merge. It will contain result image after merging.
Second image to merge.
Left position of the source image on the destination one.
Top position of the source image on the destination one.
Merge mode constant. See ImGearMergeModes enumeration.
Merges two images according to the specified merge mode.
Syntax
'Declaration
 
Public Overloads Shared Sub Merge( _
   ByVal page As ImGearRasterPage, _
   ByVal pageToMergeWith As ImGearRasterPage, _
   ByVal left As Integer, _
   ByVal top As Integer, _
   ByVal mode As ImGearMergeModes _
) 
'Usage
 
Dim page As ImGearRasterPage
Dim pageToMergeWith As ImGearRasterPage
Dim left As Integer
Dim top As Integer
Dim mode As ImGearMergeModes
 
ImGearRasterProcessing.Merge(page, pageToMergeWith, left, top, mode)
public static void Merge( 
   ImGearRasterPage page,
   ImGearRasterPage pageToMergeWith,
   int left,
   int top,
   ImGearMergeModes mode
)
public: static void Merge( 
   ImGearRasterPage* page,
   ImGearRasterPage* pageToMergeWith,
   int left,
   int top,
   ImGearMergeModes mode
) 
public:
static void Merge( 
   ImGearRasterPage^ page,
   ImGearRasterPage^ pageToMergeWith,
   int left,
   int top,
   ImGearMergeModes mode
) 

Parameters

page
First image to merge. It will contain result image after merging.
pageToMergeWith
Second image to merge.
left
Left position of the source image on the destination one.
top
Top position of the source image on the destination one.
mode
Merge mode constant. See ImGearMergeModes enumeration.
Remarks
Processes color channels only.

DIBs or both pages must have the same color space.

Use ImGearRasterProcessingVerifier.CanApplyMerge method to check whether the operation can be performed.

If the images are paletted, the arithmetic operation is applied to the pixel values (indexes) rather than to the palette entries. This may result in unexpected effect with certain palettes, for example if the palette is reversed. In such cases, consider converting the image to a non-indexed colorspace, such as Grayscale or RGB, before applying the operation.

Example
// Opens an image and merges it into an already open image.
using (FileStream file = new FileStream("photo.jpg",
                   FileMode.Open, FileAccess.Read, FileShare.Read))
{
    ImGearRasterPage igRasterPageToMerge = (ImGearRasterPage)
        ImGearFileFormats.LoadPage(file, 0);

    // Subtract the opened image from the existing image.
    ImGearRasterProcessing.Merge(igRasterPage, igRasterPageToMerge, 0, 0, ImGearMergeModes.SUB);
}
' Opens an image and merges it into an already open image.
Using file As New FileStream("photo.jpg", FileMode.Open, FileAccess.Read, FileShare.Read)
    Dim igRasterPageToMerge As ImGearRasterPage = DirectCast(ImGearFileFormats.LoadPage(file, 0), ImGearRasterPage)

    ' Subtract the opened image from the existing image.
    ImGearRasterProcessing.Merge(igRasterPage, igRasterPageToMerge, 0, 0, ImGearMergeModes.[SUB])
End Using
See Also

Reference

ImGearRasterProcessing Class
ImGearRasterProcessing Members
Overload List
ImGearRasterPage Class
ImGearMergeModes Enumeration