←Select platform

CodecsOverlayData Class

Summary
Contains information about the overlay image found in the file.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public class CodecsOverlayData 
@interface LTCodecsOverlayData : NSObject 
public class CodecsOverlayData extends LeadEvent 
public ref class CodecsOverlayData  
class CodecsOverlayData: 
Remarks

An CodecsOverlayData object is populated and passed as data to the CodecsOverlayCallback parameter passed to the RasterCodecs.StartOverlay method. Some members of this class are for input some are for output as follows:

Value Description
FileName (Input) The name of the file containing the overlay image
PageNumber (Input) Page number of the requested overlay image
Info (Input) Determines whether overlay image info or actual image is needed
InfoWidth (Output) Overlay image width in pixels (Ignore if Info is false)
InfoHeight (Output) Overlay image height in pixels (Ignore if Info is false)
InfoXResolution (Output) Overlay image horizontal resolution in pixels per inch (Ignore if Info is false)
InfoYResolution (Output) Overlay image vertical resolution in pixels per inch (Ignore if Info is false)
Image (Output) The RasterImage object containing the loaded overlay image (Only Info is false)
Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
 
void PtokaOverlayExample(string ptokaFileName, string ptokaFilesPath) 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
 
   // Set up the private variables used in the callback 
   myCodecs = codecs; 
   myPtokaFilesPath = ptokaFilesPath; 
 
   // Set the overlay callback 
   codecs.StartOverlay(CodecsOverlayCallback, CodecsOverlayCallbackMode.CallLoad); 
 
   // Load the PTOKA file 
   RasterImage image = codecs.Load(ptokaFileName); 
 
   // Stop the overlay by resetting the old callback. 
   codecs.StopOverlay(); 
 
   // Save the image as TIFF 
   string destFileName = Path.Combine(LEAD_VARS.ImagesDir, "PtokaOverlay.tif"); 
   codecs.Save(image, destFileName, RasterImageFormat.Tif, 1); 
   image.Dispose(); 
 
   // Clean up 
   codecs.Dispose(); 
} 
 
RasterCodecs myCodecs; 
string myPtokaFilesPath; 
 
void CodecsOverlayCallback(CodecsOverlayData data) 
{ 
   // Show overlay information 
   Debug.WriteLine("File: {0}", data.FileName); 
   Debug.WriteLine("Page Number: {0}", data.PageNumber); 
   Debug.WriteLine("Info: {0}", data.Info); 
 
   // Construct the overlay file name 
   string overlayFileName = Path.Combine(myPtokaFilesPath, data.FileName); 
 
   if (data.Info) 
   { 
      // Info, we only need to fill in the .InfoXXX members of the data 
      CodecsImageInfo imageInfo = myCodecs.GetInformation(overlayFileName, false); 
      data.InfoWidth = imageInfo.Width; 
      data.InfoHeight = imageInfo.Height; 
      data.InfoXResolution = imageInfo.XResolution; 
      data.InfoYResolution = imageInfo.YResolution; 
   } 
   else 
   { 
      // We need to load the overlay image into the .Image member 
      data.Image = myCodecs.Load(overlayFileName); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.5.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.