ImageGear23.Core Assembly > ImageGear.Processing Namespace > ImGearRasterProcessing Class > Blend Method : Blend(ImGearRasterPage,Int32,Int32,ImGearRasterPage,Double) Method |
'Declaration Public Overloads Shared Sub Blend( _ ByVal page As ImGearRasterPage, _ ByVal left As Integer, _ ByVal top As Integer, _ ByVal pageToBlendWith As ImGearRasterPage, _ ByVal weight As Double _ )
'Usage Dim page As ImGearRasterPage Dim left As Integer Dim top As Integer Dim pageToBlendWith As ImGearRasterPage Dim weight As Double ImGearRasterProcessing.Blend(page, left, top, pageToBlendWith, weight)
public static void Blend( ImGearRasterPage page, int left, int top, ImGearRasterPage pageToBlendWith, double weight )
public: static void Blend( ImGearRasterPage* page, int left, int top, ImGearRasterPage* pageToBlendWith, double weight )
public: static void Blend( ImGearRasterPage^ page, int left, int top, ImGearRasterPage^ pageToBlendWith, double weight )
This method blends all channels of page with corresponding channels of pageToBlendWith, using the following formula:
pagePixel = (pagePixel * (100.0 - weight) + pageToBlendPixel * weight) / 100.0
The method validates input pages for further processing according to following logics:
The method processes the input pages according to following logics:
// Opens an image and blends it into an already open image. using (FileStream file = new FileStream("photo.jpg", FileMode.Open, FileAccess.Read, FileShare.Read)) { ImGearRasterPage igPageToBlend = (ImGearRasterPage) ImGearFileFormats.LoadPage(file, 0); // Blend the page with a weight of 25% starting from the point 100,100. ImGearRasterProcessing.Blend(igRasterPage, 100, 100, igPageToBlend, 25.0); }
' Opens an image and blends it into an already open image. Using file As New FileStream("photo.jpg", FileMode.Open, FileAccess.Read, FileShare.Read) Dim igPageToBlend As ImGearRasterPage = DirectCast(ImGearFileFormats.LoadPage(file, 0), ImGearRasterPage) ' Blend the page with a weight of 25% starting from the point 100,100. ImGearRasterProcessing.Blend(igRasterPage, 100, 100, igPageToBlend, 25) End Using