GDI+ PathGradientBrush OutOfMemoryException
来源:互联网 发布:淘宝网mac版 编辑:程序博客网 时间:2024/05/16 04:55
最近做的项目,需要用GDI+来绘制一些三角网格。
其中需要用色标颜色来填充这些三角网格,所以用到了PathGradientBrush画刷,如下图:
用PathGradientBrush填充的三角网格
但是在填充这些三角形的时候,总是抛出OutOfMemoryException(内存不足)的异常。
找来找去才发现是 new PathGradientBrush(pf)这里的点集 pf 出了问题。
所以几番实验发现,这里的点集的面积不能为0。否则在新建画刷PathGradientBrush的时候就会出错。
于是,我在绘制之前加入了面积判断就没问题了:
if (VisualTool.polygonArea(pf) < 1)
{
continue;
}
阅读全文
0 0
- GDI+ PathGradientBrush OutOfMemoryException
- PathGradientBrush
- GDI+ for VCL基础 -- 画刷之PathGradientBrush
- 使用PathGradientBrush类
- System.OutOfMemoryException
- System.OutOfMemoryException
- System.OutOfMemoryException
- System.OutOfMemoryException
- System.OutOfMemoryException
- OutOfMemoryException异常
- System.OutOfMemoryException
- C# PathGradientBrush 处理颜色渐渐变
- 学习使用PathGradientBrush的小程序
- ASP.NET中的OutOfMemoryException
- ASP.NET中的OutOfMemoryException
- 如何处理OutOfMemoryException异常
- OutOfMemoryException and Pinning
- 如何处理OutOfMemoryException异常 ?
- 了解一下 display:flex;
- 万能头文件#include<bits/stdc++.h>
- 缓存概述
- DOS窗口下的命令操作
- 面向服务
- GDI+ PathGradientBrush OutOfMemoryException
- 总结:进制间的转换
- 第一章 Spring之旅
- 安全组规则批量添加授权对象
- discuz 地区下拉框联动用方法
- spring实战-Spring-security权限认证白名单
- 四大组件之ContentProvider
- Windows ToolTips简要介绍
- Spring boot 搭建个人博客系统(四)——文章的发布和分页显示