CodecsThumbnailOptions Structure (original) (raw)

Summary

Options used when loading a thumbnail from an image file.

Syntax

C#

Objective-C

C++/CLI

Java

Python

public struct CodecsThumbnailOptions 
@interface LTCodecsThumbnailOptions : NSObject 
public final class CodecsThumbnailOptions 
public value class CodecsThumbnailOptions : public System.ValueType  
class CodecsThumbnailOptions: 

Example

using Leadtools; using Leadtools.Codecs; using Leadtools.ImageProcessing; using Leadtools.ImageProcessing.Color; using Leadtools.Svg; public void ReadThumbnailExample() { RasterCodecs codecs = new RasterCodecs(); string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp"); // Create a thumbnail with default options CodecsThumbnailOptions options = CodecsThumbnailOptions.Default; options.LoadStamp = false; RasterImage thumbnail = codecs.ReadThumbnail(srcFileName, options, 1); Debug.WriteLine("Thumbnail with default option:"); Debug.WriteLine(" Size: {0} by {1} pixels. Bits/Pixel: {2}", thumbnail.Width, thumbnail.Height, thumbnail.BitsPerPixel); thumbnail.Dispose(); // Create a thumbnail with some options options.LoadStamp = false; options.Width = 40; options.Height = 80; options.ForceSize = true; options.MaintainAspectRatio = false; options.BackColor = RasterColor.FromKnownColor(RasterKnownColor.LightBlue); options.BitsPerPixel = 8; options.DitheringMethod = RasterDitheringMethod.None; options.Order = RasterByteOrder.Rgb; options.PaletteFlags = ColorResolutionCommandPaletteFlags.None; options.Resample = false; thumbnail = codecs.ReadThumbnail(srcFileName, options, 1); Debug.WriteLine("Thumbnail with set option (size: {0} by {1}, Bits/Pixel: {2}, ForeSize: {3}", options.Width, options.Height, options.BitsPerPixel, options.ForceSize); Debug.WriteLine(" Size: {0} by {1} pixels. Bits/Pixel: {2}", thumbnail.Width, thumbnail.Height, thumbnail.BitsPerPixel); thumbnail.Dispose(); codecs.Dispose(); } static class LEAD_VARS { public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; }

Leadtools.Codecs Assembly

CompactFile(Stream,Stream,int,int,bool,int,int,bool,int,CodecsSavePageMode,bool,bool) Method

CompactFile(Stream,Stream,int,int,bool,long,int,bool,long,CodecsSavePageMode,bool,bool,bool) Method

CompactFile(string,string,int,int,bool,int,int,bool,int,CodecsSavePageMode,bool,bool) Method

CompactFile(string,string,int,int,bool,long,int,bool,long,CodecsSavePageMode,bool,bool,bool) Method

StartCompress(int,int,int,RasterByteOrder,RasterViewPerspective,int,byte[],int,int,CodecsCompression,CodecsCompressDataCallback) Method