使用PathGradientBrush导致内存不足? [英] Error out of memory using PathGradientBrush ?

查看:109
本文介绍了使用PathGradientBrush导致内存不足?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好家伙的



请任何人帮我解决这个错误:内存不足。
当我尝试绘制多边形时
使用PathGradientBrush

这是我的代码:



  Dim  p1  As  点( 140  130 
Dim p2 正如 点( 180 130
Dim p3 As 点( 200 150
Dim p4 作为 点( 180 170
Dim p5 作为 点( 140 170
Dim p6 作为 点( 120 150
Dim shape As Point()= {p1,p2,p3,p4,p5,p6}
Dim path As GraphicsPath(FillMode.Alternate)
Dim gra1 作为 PathGradientBrush(path)
gra1.CenterColor = Color.FromArgb( 200 ,Color.MediumViole tRed)
Dim colors As Color()= {Color.FromArgb( 200 ,Color.Red),Color.Yellow}
gra1.SurroundColors = colors
path.AddPolygon(shape)
g.FillPolygon(gra1,形状)

解决方案

通过移动解决问题

path.AddPolygon(形状)

并在gra1定义之前写入。


Hello ...................... ........ !!

hello guy's

please could any one help me with this error : out of memory .
when i try to draw a polygon using the PathGradientBrush
this is my code:

Dim p1 As New Point(140, 130)
     Dim p2 As New Point(180, 130)
     Dim p3 As New Point(200, 150)
     Dim p4 As New Point(180, 170)
     Dim p5 As New Point(140, 170)
     Dim p6 As New Point(120, 150)
     Dim shape As Point() = {p1, p2, p3, p4, p5, p6}
     Dim path As New GraphicsPath(FillMode.Alternate)
     Dim gra1 As New PathGradientBrush(path)
     gra1.CenterColor = Color.FromArgb(200, Color.MediumVioletRed)
     Dim colors As Color() = {Color.FromArgb(200, Color.Red), Color.Yellow}
     gra1.SurroundColors = colors
     path.AddPolygon(shape)
     g.FillPolygon(gra1, shape)

解决方案

the problem is solved by moving
path.AddPolygon(shape)
and write it before the gra1 definition.


Hello ..............................!!


这篇关于使用PathGradientBrush导致内存不足?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆