Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction | Help Version 19.0.7.12
|
Property | Value |
Dock | Fill |
[Visual Basic]
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Controls.WinForms
Imports Leadtools.ImageProcessing
[C#]
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Controls.WinForms;
using Leadtools.ImageProcessing;
[Visual Basic]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' intitialize a new RasterCodecs object
Dim codecs As New RasterCodecs()
' load the main image into our viewer
RasterImageViewer1.Image = codecs.Load("C:\Users\Public\Documents\LEADTOOLS Images\Sample1.cmp")
' load the temporary image
Dim tempImage As RasterImage = codecs.Load("C:\Users\Public\Documents\LEADTOOLS Images\Sample2.cmp")
' add a region to the image
tempImage.AddRectangleToRegion(Nothing, New LeadRect(100, 100, 200, 200), RasterRegionCombineMode.Set)
' combine
Dim combine As New CombineFastCommand()
combine.DestinationImage = RasterImageViewer1.Image
combine.DestinationRectangle = New LeadRect(0, 0, tempImage.ImageWidth, tempImage.ImageHeight)
combine.SourcePoint = LeadPoint.Empty
combine.Flags = CombineFastCommandFlags.OperationAverage
combine.Run(tempImage)
tempImage.Dispose()
End Sub
[C#]
private void Form1_Load(object sender, System.EventArgs e)
{
// intitialize a new RasterCodecs object
RasterCodecs codecs = new RasterCodecs();
// load the main image into our viewer
rasterImageViewer1.Image = codecs.Load(@"C:\Users\Public\Documents\LEADTOOLS Images\Sample1.cmp");
// load the temporary image
using(RasterImage tempImage = codecs.Load(@"C:\Users\Public\Documents\LEADTOOLS Images\Sample2.cmp"))
{
// add a region to the image
tempImage.AddRectangleToRegion(null, new Rectangle(100, 100, 200, 200), RasterRegionCombineMode.Set);
// combine
CombineFastCommand combine = new CombineFastCommand();
combine.DestinationImage = rasterImageViewer1.Image;
combine.DestinationRectangle = new Rectangle(0, 0, tempImage.ImageWidth, tempImage.ImageHeight);
combine.SourcePoint = Point.Empty;
combine.Flags = CombineFastCommandFlags.OperationAverage;
combine.Run(tempImage);
}
}