我有一個運行在XP和Vista就好了一個.NET 2.0的應用程序,但在Windows 7 RC(64位),它與下面的錯誤崩潰:Windows 7的TextureBrush..ctor()錯誤
異常信息
異常類型:的System.OutOfMemoryException 消息:內存。 數據:System.Collections.ListDictionaryInternal TargetSite:空隙.ctor(System.Drawing.Image對象,System.Drawing.Drawing2D.WrapMode) HELPLINK:NULL 來源:System.Drawing中
堆棧跟蹤信息
at System.Drawing.TextureBrush..ctor(Image image,WrapMode wrapMode) at System.Windows.Forms.ControlPaint.DrawBackgroundImage(Graphics g,Image backgroundImage,Color backColor,ImageLayout backgroundImageLayout,Rectangle bounds,Rectangle clipRect,Point scrollOffset ,RightToLeft rightToLeft) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e,Rectangle rectangle,Color backColor,Point scrollOffset) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e,Rectangle rectangle) at System.Windows.Forms。在System.Windows.Forms的System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,Int16圖層,布爾disposeEventArgs)上的System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs e) .Control.WmPaint(消息&米) 在System.Windows.Forms.Control.WndProc(消息&米) 在System.Windows.Forms.ScrollableControl.WndProc(消息&米)
有關爲什麼會發生這種情況的任何想法,或者我如何編程?這只是繪製一個沒有特殊背景的標準winform。
更新: 我發現這只是一個問題,當BackgroundImageLayout = ImageLayout.Tile,這也是默認的。將其設置爲「縮放」或「居中」,問題消失。雖然這很不理想,因爲我需要它來平鋪。
它可以在XP和Vista ** 64位**上正常工作嗎? – 2009-04-30 21:13:48
是的,它在32位和64位版本的XP和Vista上都能正常工作。 – 2009-04-30 21:16:03
謝謝(這是在黑暗中拍攝的,最近出現了一些與cross-arch問題相似的問題。)對不起,沒有想法。 – 2009-04-30 21:21:38