←选择平台

GlobalMemoryThresholds结构

总结
保存分配新内存时使用的常规内存限制RasterImage对象。
语法
c#
VB
objective - c
c++
Java
公共结构体GlobalMemoryThresholds
公共结构GlobalMemoryThresholds
@接口GlobalMemoryThresholds: NSObject
公共GlobalMemoryThresholds
公共结构体GlobalMemoryThresholds
讲话

使用RasterDefaults。GetGlobalMemoryThresholds而且RasterDefaults。SetGlobalMemoryThresholds获取或设置分配new时使用的常规内存限制RasterImage对象。

GlobalMemoryThresholds包含以下成员:

成员 描述
MaximumConventionalMemory 对象时使用的连续常规内存的最大大小(以字节为单位)RasterImage对象。
例子
c#
VB
使用Leadtools;使用Leadtools.Codecs;公共静态无效MaximumConventionalMemoryTest ()控制台。WriteLine (“maximumConventionalMemoryTest”);字符串imageFileName =@“C: \ LEADTOOLS21 \资源\ \ Leadtools.pdf图像”Size = 0;使用varrasterCodecs =RasterCodecs ())使用varrasterImage = rasterCodecs。负载(imageFileName, 1))控制台。WriteLine ("已加载,大小:{0}常规:{1}磁盘:{2}"rasterImage。DataSize,rasterImage。IsConventionalMemory rasterImage.IsDiskMemory);Debug.Assert (rasterImage.IsConventionalMemory);Debug.Assert (! rasterImage.IsDiskMemory);size = rasterImage.DataSize;//设置最大常规大小为位图的一半,然后重新检查。应该是磁盘GlobalMemoryThresholds thresholds = RasterDefaults.GetGlobalMemoryThresholds();控制台。WriteLine (原始GlobalMemoryThresholds”。MaximumConventionalMemory = {0}", thresholds.MaximumConventionalMemory);阈值。MaximumConventionalMemory = size / 2;RasterDefaults.SetGlobalMemoryThresholds(阈值);thresholds = RasterDefaults.GetGlobalMemoryThresholds();控制台。WriteLine (“新GlobalMemoryThresholds。MaximumConventionalMemory ={0}", thresholds.MaximumConventionalMemory);使用varrasterImage = rasterCodecs。负载(imageFileName, 1))控制台。WriteLine ("已加载,大小:{0}常规:{1}磁盘:{2}"rasterImage。DataSize,rasterImage。IsConventionalMemory rasterImage.IsDiskMemory);Debug.Assert (! rasterImage.IsConventionalMemory);Debug.Assert (rasterImage.IsDiskMemory);//现在设置为-1,并尝试创建一个20 × 20的32 bpp英寸位图,应该是磁盘/ /重置RasterDefaults.SetGlobalMemoryThresholds (GlobalMemoryThresholds.Default);thresholds = RasterDefaults.GetGlobalMemoryThresholds();控制台。WriteLine (原始GlobalMemoryThresholds”。MaximumConventionalMemory = {0}", thresholds.MaximumConventionalMemory);阈值。maximum常规内存= -1;RasterDefaults.SetGlobalMemoryThresholds(阈值);thresholds = RasterDefaults.GetGlobalMemoryThresholds();控制台。WriteLine (“新GlobalMemoryThresholds。MaximumConventionalMemory ={0}", thresholds.MaximumConventionalMemory);使用varrasterImage =RasterImage (RasterMemoryFlags。传统的,20 * 300,20 * 300,32岁的RasterByteOrder。Bgr,RasterViewPerspective。TopLeft,0))控制台。WriteLine ("created, size:{0} Conventional:{1} Disk:{2}"rasterImage。DataSize,rasterImage。IsConventionalMemory rasterImage.IsDiskMemory);Debug.Assert (! rasterImage.IsConventionalMemory);Debug.Assert (rasterImage.IsDiskMemory);//最终创建8.5乘11在300 DPI,应该是conv使用varrasterImage =RasterImage (RasterMemoryFlags。传统的,int)(8.5 * 300),11 * 300,32岁的RasterByteOrder。Bgr,RasterViewPerspective。TopLeft,0))控制台。WriteLine ("created, size:{0} Conventional:{1} Disk:{2}"rasterImage。DataSize,rasterImage。IsConventionalMemory rasterImage.IsDiskMemory);Debug.Assert (rasterImage.IsConventionalMemory);Debug.Assert (! rasterImage.IsDiskMemory);/ /重置RasterDefaults.SetGlobalMemoryThresholds (GlobalMemoryThresholds.Default);
进口Leadtools进口Leadtools。编解码器进口Leadtools。ImageProcessing公共共享MaximumConventionalMemoryTest ()控制台。WriteLine (“maximumConventionalMemoryTest”昏暗的imageFileName作为字符串“C: \ LEADTOOLS21 \资源\ \ Leadtools.pdf图像”昏暗的大小作为= 0使用rasterCodecs作为RasterCodecs ()使用rasterImage作为光栅图像=光栅编解码器。负载(imageFileName, 1)控制台。WriteLine ("已加载,大小:{0}常规:{1}磁盘:{2}"rasterImage。DataSize,rasterImage。IsConventionalMemory rasterImage.IsDiskMemory)Debug.Assert (rasterImage.IsConventionalMemory)调试。作为sert(rasterImage.IsDiskMemory)size = rasterImage。DataSize结束使用'将最大常规尺寸设置为位图的一半,然后重新检查。应该是磁盘昏暗的阈值作为GlobalMemoryThresholds = RasterDefaults.GetGlobalMemoryThresholds()控制台。WriteLine (原始GlobalMemoryThresholds”。MaximumConventionalMemory = {0}"thresholds.MaximumConventionalMemory)阈值。MaximumConventionalMemory =CType(大小/ 2,RasterDefaults.SetGlobalMemoryThresholds(阈值)thresholds = RasterDefaults.GetGlobalMemoryThresholds()控制台。WriteLine (“新GlobalMemoryThresholds。MaximumConventionalMemory ={0}"thresholds.MaximumConventionalMemory)使用rasterImage作为光栅图像=光栅编解码器。负载(imageFileName, 1)控制台。WriteLine ("已加载,大小:{0}常规:{1}磁盘:{2}"rasterImage。DataSize,rasterImage。IsConventionalMemory rasterImage.IsDiskMemory)调试。作为sert(rasterImage.IsConventionalMemory)Debug.Assert (rasterImage.IsDiskMemory)结束使用'现在设置为-1,并尝试创建一个20 × 20的32 bpp英寸位图,应该是磁盘“重置RasterDefaults.SetGlobalMemoryThresholds (GlobalMemoryThresholds。默认的thresholds = RasterDefaults.GetGlobalMemoryThresholds()控制台。WriteLine (原始GlobalMemoryThresholds”。MaximumConventionalMemory = {0}"thresholds.MaximumConventionalMemory)阈值。MaximumConventionalMemory = -1RasterDefaults.SetGlobalMemoryThresholds(阈值)thresholds = RasterDefaults.GetGlobalMemoryThresholds()控制台。WriteLine (“新GlobalMemoryThresholds。MaximumConventionalMemory ={0}"thresholds.MaximumConventionalMemory)使用rasterImage作为RasterImage (RasterMemoryFlags。传统的,20 * 300,20 * 300,32岁的RasterByteOrder。Bgr,RasterViewPerspective。TopLeft,没有什么没有什么0)控制台。WriteLine ("created, size:{0} Conventional:{1} Disk:{2}"rasterImage。DataSize,rasterImage。IsConventionalMemory rasterImage.IsDiskMemory)调试。作为sert(rasterImage.IsConventionalMemory)Debug.Assert (rasterImage.IsDiskMemory)结束使用'最终创建8.5乘11在300 DPI,应该是conv使用rasterImage作为RasterImage (RasterMemoryFlags。传统的,CInt(8.5 * 300),11 * 300,32岁的RasterByteOrder。Bgr,RasterViewPerspective。TopLeft,没有什么没有什么0)控制台。WriteLine ("created, size:{0} Conventional:{1} Disk:{2}"rasterImage。DataSize,rasterImage。IsConventionalMemory rasterImage.IsDiskMemory)Debug.Assert (rasterImage.IsConventionalMemory)调试。作为sert(rasterImage.IsDiskMemory)结束使用结束使用“重置RasterDefaults.SetGlobalMemoryThresholds (GlobalMemoryThresholds。默认的结束
需求
目标平台
Leadtools组装
188金宝搏的网址客服|支持|联系我们|知识产权公告
©1991 - 2021领德科技有限公司版权所有。