Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, October 19, 2017 4:08:26 PM(UTC)

Nick  
Nick

Groups: Registered, Tech Support, Administrators
Posts: 161

Was thanked: 9 time(s) in 9 post(s)

For images which have been split apart across multiple files, LEADTOOLS can be used to consolidate them into one composite image. Here's how to use the CombineCommand to recreate an image previously divided.
https://www.leadtools.com/help/leadtools/v19/dh/pe/combinecommand.html

Code:

 using (RasterCodecs codecs = new RasterCodecs())
 {
    RasterImage left = codecs.Load("cropthird.jpg");
    RasterImage center = codecs.Load("cropthird2.jpg");
    RasterImage right = codecs.Load("cropthird3.jpg");

    RasterImage newImage = new RasterImage(RasterMemoryFlags.Conventional, left.Width + center.Width + right.Width, left.Height, 24, RasterByteOrder.Rgb, RasterViewPerspective.BottomLeft, null, null, 0);

    CombineCommand cc = new CombineCommand();

    cc.SourceImage = left;
    cc.DestinationRectangle = new LeadRect(0, 0, left.Width, left.Height);
    cc.Run(newImage);

    cc.SourceImage = center;
    cc.DestinationRectangle = new LeadRect(left.Width, 0, center.Width, center.Height);
    cc.Run(newImage);

    cc.SourceImage = right;
    cc.DestinationRectangle = new LeadRect(left.Width + center.Width, 0, right.Width, right.Height);
    cc.Run(newImage);

    codecs.Save(newImage, "combinedimage.jpg", RasterImageFormat.Jpeg, 0);
 }

Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.094 seconds.