public CodecsOverlayData() - (instancetype)init public:CodecsOverlayData();
__init__() # Default constructor 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 callbackmyCodecs = codecs;myPtokaFilesPath = ptokaFilesPath;// Set the overlay callbackcodecs.StartOverlay(CodecsOverlayCallback, CodecsOverlayCallbackMode.CallLoad);// Load the PTOKA fileRasterImage image = codecs.Load(ptokaFileName);// Stop the overlay by resetting the old callback.codecs.StopOverlay();// Save the image as TIFFstring destFileName = Path.Combine(LEAD_VARS.ImagesDir, "PtokaOverlay.tif");codecs.Save(image, destFileName, RasterImageFormat.Tif, 1);image.Dispose();// Clean upcodecs.Dispose();}RasterCodecs myCodecs;string myPtokaFilesPath;void CodecsOverlayCallback(CodecsOverlayData data){// Show overlay informationDebug.WriteLine("File: {0}", data.FileName);Debug.WriteLine("Page Number: {0}", data.PageNumber);Debug.WriteLine("Info: {0}", data.Info);// Construct the overlay file namestring overlayFileName = Path.Combine(myPtokaFilesPath, data.FileName);if (data.Info){// Info, we only need to fill in the .InfoXXX members of the dataCodecsImageInfo 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 memberdata.Image = myCodecs.Load(overlayFileName);}}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";}
import java.io.*;import java.net.*;import java.nio.file.Paths;import java.util.*;import java.time.Instant;import java.time.Duration;import org.junit.*;import org.junit.runner.JUnitCore;import org.junit.runner.Result;import org.junit.runner.notification.Failure;import static org.junit.Assert.*;import leadtools.*;import leadtools.codecs.*;import leadtools.codecs.RasterCodecs.FeedCallbackThunk;import leadtools.drawing.internal.*;import leadtools.imageprocessing.*;import leadtools.imageprocessing.color.ChangeIntensityCommand;import leadtools.svg.*;public void ptokaOverlayExample() {final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images";String ptokaFileName = combine(LEAD_VARS_IMAGES_DIR, "jbig.jbg");RasterCodecs codecs = new RasterCodecs();// Set up the private variables used in the callbackmyCodecs = codecs;myPtokaFilesPath = LEAD_VARS_IMAGES_DIR;// Set the overlay callbackcodecs.startOverlay(codecsOverlayCallback, CodecsOverlayCallbackMode.CALL_LOAD);// Load the PTOKA fileRasterImage image = codecs.load(ptokaFileName);// Stop the overlay by resetting the old callback.codecs.stopOverlay();// Save the image as TIFFString destFileName = combine(LEAD_VARS_IMAGES_DIR, "PtokaOverlay.tif");codecs.save(image, destFileName, RasterImageFormat.TIF, 1);image.dispose();// Clean upcodecs.dispose();}RasterCodecs myCodecs;String myPtokaFilesPath;CodecsOverlayListener codecsOverlayCallback = new CodecsOverlayListener() {@Overridepublic void onOverlay(CodecsOverlayData data) {// Show overlay informationSystem.out.println("File: " + data.getFileName());System.out.println("Page Number: " + data.getPageNumber());System.out.println("Info: " + data.getInfo());// Construct the overlay file nameString overlayFileName = combine(myPtokaFilesPath, data.getFileName());if (data.getInfo()) {// Info, we only need to fill in the .InfoXXX members of the dataCodecsImageInfo imageInfo = myCodecs.getInformation(overlayFileName, false);data.setInfoWidth(imageInfo.getWidth());data.setInfoHeight(imageInfo.getHeight());data.setInfoXResolution(imageInfo.getXResolution());data.setInfoYResolution(imageInfo.getYResolution());} else {// We need to load the overlay image into the .Image memberdata.setImage(myCodecs.load(overlayFileName));}}};
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
