Canvas does not allow drawing 问题

loveheronly 2012-10-30 11:15:13
Canvas does not allow drawing 这是C++ builder开发的ocx控件,程序里面并没有调用到Canvas 相关的内容,程序运行到一定时间,就弹出该对话框。求高手帮忙解释,什么情况下会发生该异常
...全文
4334 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
明日船长 2014-12-30
  • 打赏
  • 举报
回复
楼主,你这问题怎么解决的,我也碰到了,无从下手啊,请赐教
ccrun.com 2012-10-30
  • 打赏
  • 举报
回复
你说程序里没有调用Canvas, 只是没有显式的调用而已.

出现 "Canvas does not allow drawing" 一般是因为资源溢出, 相关的设备环境(HDC)有问题了. 如果是显式调用的, 可以通过Canvas的Lock来保障一下.
loveheronly 2012-10-30
  • 打赏
  • 举报
回复
我用try catch处理先
ccrun.com 2012-10-30
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 的回复:]
但是该Image都没有调用Canvas,太怪异了
[/Quote]

这是内部机制.
你试着调试看看, 是不是将Image隐藏后的某个时间弹出的这个异常提示?
loveheronly 2012-10-30
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 的回复:]
目测是Image的Canvas出了问题. 你尝试屏蔽掉部分代码, 逐渐的调试吧.
[/Quote]
但是该Image都没有调用Canvas,太怪异了
ccrun.com 2012-10-30
  • 打赏
  • 举报
回复
目测是Image的Canvas出了问题. 你尝试屏蔽掉部分代码, 逐渐的调试吧.
loveheronly 2012-10-30
  • 打赏
  • 举报
回复
1)这个控件在创建事件里面就已经将图片加载了
Image1->Picture->LoadFromFile("path");
2)根据WndProc函数的消息,而对Image控件是否可见,是否可用作处理的
3)WndProc函数的消息,这个大概平均每一秒都有
loveheronly 2012-10-30
  • 打赏
  • 举报
回复
这个ocx里面有有三个图片Image控件,引用到WndProc(Messages::TMessage & Message)这个window消息函数,专门根据这里面的消息而显示不同的图片的
ccrun.com 2012-10-30
  • 打赏
  • 举报
回复
你这个OCX是做什么用的?
loveheronly 2012-10-30
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]
你说程序里没有调用Canvas, 只是没有显式的调用而已.

出现 "Canvas does not allow drawing" 一般是因为资源溢出, 相关的设备环境(HDC)有问题了. 如果是显式调用的, 可以通过Canvas的Lock来保障一下.
[/Quote]
是啊,没有显式调用。资源溢出, 相关的设备环境(HDC)有问题,这个是指?
Version 1.7 ----------- - ADD: Delphi/CBuilder 10.2 Tokyo now supported. - ADD: Delphi/CBuilder 10.1 Berlin now supported. - ADD: Delphi/CBuilder 10 Seattle now supported. - ADD: Delphi/CBuilder XE8 now supported. - ADD: Delphi/CBuilder XE7 now supported. - ADD: Delphi/CBuilder XE6 now supported. - ADD: Delphi/CBuilder XE5 now supported. - ADD: Delphi/CBuilder XE4 now supported. - ADD: Delphi/CBuilder XE3 now supported. - ADD: Delphi/CBuilder XE2 now supported. - ADD: Delphi/CBuilder XE now supported. - ADD: Delphi/CBuilder 2010 now supported. - ADD: Delphi/CBuilder 2009 now supported. - ADD: New demo project FlexCADImport. - FIX: The height of the TFlexRegularPolygon object incorrectly changes with its rotation. - FIX: Added division by zero protect in method TFlexControl.MovePathSegment. - FIX: The background beyond docuemnt wasn't filled when TFlexPanel.DocClipping=True. - FIX: In "Windows ClearType" font rendering mode (OS Windows mode) the "garbage" pixels can appear from the right and from the bottom sides of the painted rectangle of the TFlexText object. - FIX: The result rectangle incorrectly calculated in the TFlexText.GetRefreshRect method. - FIX: Added FPaintCache.rcPaint cleanup in the TFlexPanel.WMPaint method. Now it is possible to define is the drawing take place via WMPaint or via the PaintTo direct call (if rcPaint contain non-empty rectangle then WMPaint in progress). - FIX: The TFlexPanel.FPaintCache field moved in the protected class section. Added rcPaint field in FPaintCache that represents drawing rectangle. - ADD: In the text prcise mode (TFlexText.Precise=True) takes into account the rotation angle (TFlexText.Angle). - FIX: Removed FG_NEWTEXTROTATE directive (the TFlexText Precise mode should be used instead). - FIX: The TFlexRegularPolygon object clones incorrectly drawed in case when TFlexRegularPolygon have alternative brush (gradient, texture). - ADD: Add TFlexPanel.InvalidateControl virtual method which calls from TFle

703

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder ActiveX/COM/DCOM
社区管理员
  • ActiveX/COM/DCOM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧