←Select platform

ConventionalTiles Property

Summary
Gets or sets a value that specifies the maximum number of tiles that will reside in conventional memory at any time.
Syntax
C#
C++/CLI
Python
public int ConventionalTiles { get; set; } 
public: 
property int ConventionalTiles { 
   int get(); 
   void set (    int ); 
} 
ConventionalTiles # get and set (RasterMemoryThreshold) 

Property Value

An integer value that specifies the maximum number of tiles that will reside in conventional memory at any time. Default is 0.

Remarks

ConventionalTiles is used when working with a tiled image. The tiles that do not reside in conventional memory will be on disk. (Default is -100 = all tiles are in memory)

If the ConventionalTiles value is > 0, then this parameter represents the number of tiles.

If the ConventionalTiles value is 0, then all the tiles in a tiled image will be disk tiles.

If the ConventionalTiles value is < 0, then this parameter represents the percentage of tiles that will reside in memory.

Values less than -100 are not allowed.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
 
 
public void RasterDefaultsExample() 
{ 
	// Set the limit for RasterImage object allocations 
	RasterMemoryThreshold threshold = RasterDefaults.MemoryThreshold; 
	threshold.MaximumGlobalRasterImageMemory = 20 * 1000 * 1024; 
	RasterDefaults.MemoryThreshold = threshold; 
 
	ShowValues(); 
 
	// Create a raster image with current DPI 
	RasterImage image1 = new RasterImage( 
	   RasterMemoryFlags.Conventional, 
	   100, 
	   100, 
	   24, 
	   RasterByteOrder.Bgr, 
	   RasterViewPerspective.TopLeft, 
	   null, 
	   IntPtr.Zero, 
	   0); 
	Console.WriteLine("Resolution of created image is {0} by {1} DPI", image1.XResolution, image1.YResolution); 
 
	// Change the resolution 
	int xOldResolution = RasterDefaults.XResolution; 
	int yOldResolution = RasterDefaults.YResolution; 
	int xNewResolution = 196; 
	int yNewResolution = 196; 
	RasterDefaults.XResolution = xNewResolution; 
	RasterDefaults.YResolution = yNewResolution; 
	ShowValues(); 
 
	// Create another raster image 
	// Create a raster image with current DPI 
	RasterImage image2 = new RasterImage( 
	   RasterMemoryFlags.Conventional, 
	   100, 
	   100, 
	   24, 
	   RasterByteOrder.Bgr, 
	   RasterViewPerspective.TopLeft, 
	   null, 
	   IntPtr.Zero, 
	   0); 
	Console.WriteLine("Resolution of created image is {0} by {1} DPI", image2.XResolution, image2.YResolution); 
	Debug.Assert(image2.XResolution == xNewResolution); 
	Debug.Assert(image2.YResolution == yNewResolution); 
 
	// Reset old values 
	RasterDefaults.XResolution = xOldResolution; 
	RasterDefaults.YResolution = yOldResolution; 
 
	image1.Dispose(); 
	image2.Dispose(); 
} 
 
void ShowValues() 
{ 
	Console.WriteLine("Current defaults:"); 
	Console.WriteLine("MaximumThreadCount: {0}", RasterDefaults.MaximumThreadCount); 
	Console.WriteLine("XResolution: {0}", RasterDefaults.XResolution); 
	Console.WriteLine("YResolution: {0}", RasterDefaults.YResolution); 
	Console.WriteLine("DitheringMethod: {0}", RasterDefaults.DitheringMethod); 
	Console.WriteLine("MemoryFlags: {0}", RasterDefaults.MemoryFlags); 
 
	RasterMemoryThreshold threshold = RasterDefaults.MemoryThreshold; 
	Console.WriteLine("MemoryThreshold.TiledThreshold: {0}", threshold.TiledThreshold); 
	Console.WriteLine("MemoryThreshold.MaximumConventionalSize: {0}", threshold.MaximumConventionalSize); 
	Console.WriteLine("MemoryThreshold.TileSize: {0}", threshold.TileSize); 
	Console.WriteLine("MemoryThreshold.ConventionalTiles: {0}", threshold.ConventionalTiles); 
	Console.WriteLine("MemoryThreshold.ConventionalBuffers: {0}", threshold.ConventionalBuffers); 
	Console.WriteLine("MemoryThreshold.MaximumGlobalRasterImageMemory: {0}", threshold.MaximumGlobalRasterImageMemory); 
 
	Console.WriteLine("TemporaryDirectory: {0}", RasterDefaults.TemporaryDirectory); 
} 
Requirements

Target Platforms

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

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