QImage 图画问题!

zhouw_326 2010-03-16 11:04:15
哪位高人知道 我这个Image 为啥是花的。

背景是透明的 结果重写paint函数后 就变成这样子了

m_pathRect = m_svgPath->path.boundingRect().normalized().adjusted(-rad, -rad, +rad, +rad);

m_maskImage = QImage(m_pathRect.toRect().size(), QImage::Format_ARGB32_Premultiplied); // 构建画布
QPainter painter(&m_maskImage);
//painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(m_svgPath->pen);
painter.drawPath(m_svgPath->path);


void C_GrapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
drawImage(m_pathRect,m_maskImage);
}

上面是Image 下面是paint
...全文
195 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhouw_326 2010-03-16
  • 打赏
  • 举报
回复
谢谢你的回答,问题解决了,但是我没有确凿的理由。
我在构造函数里面 QImage了以后,直接drawPath, paint后,出来时花的。

我考虑了再三,我觉得是paint的时候,QImage中有些随机值,也画上去了。

所以我在 QImage后,用了 fill(0)函数,在drawPath,问题就解决了。
MicroSky2813 2010-03-16
  • 打赏
  • 举报
回复
没有图……
算法和计算理论手册提出广泛的处理算法,数据结构和计算理论。 在这种学科的主科地区周围组织,这种资源在有关的科学和工程学科里服务于计算机科学家,工程师和其他专业人士。 书包含来自应用领域说明基本的概念和技术怎样一同来提供优雅的解决重要的实际的问题的方法的章。 提出反映出开业医生的需要的一个平衡的远景。 给算法和数据结构包括更多页比适合理论期的完全。 在它的理论的问题的讨论过程中强调实际的应用。 包含在字符串匹配,数据结构和有限的精密上的广泛的讨论。 提供彻底的B树的报告。 集中于实际的算法,即使他们不渐近最佳。 略述算法的技术具有关键的重要性的具体的申请 算法和计算理论手册是一次也包括很多理论的问题的算法和数据结构的广泛的收集。 它提供反映出开业医生的需要的一个平衡的远景,在在理论的问题上的讨论内包括关于应用的重点。 章包括关于算法的技术特别重要的具体的算法的有限的精密问题和讨论的信息, 包括图画,机器人技术,形成VLSI 片,视力和图象处理,数据压缩和密码术。 书也提出在和平行/ 分布计算的组合优化的一些先进题目。组织技术的算法和数据特别重要的应用领域 图画 机器人算法 VLSI 布局 视力和图像处理算法 安排 电子现金 数据压缩 动态的图算法 在线算法 多维数据结构 密码术 在组合优化和平行/被分配的计算里的高级题目 算法和计算理论手册的独特的新闻报导为研究人员和在这些应用领域的开业医生使它为必要的参考。 Algorithms and Theory of Computation Handbook presents a comprehensive treatment of algorithms, data structures, and theory of computation. Organized around the main subject areas of the discipline, this resource serves computer scientists, engineers, and other professionals in related scientific and engineering disciplines. The book contains chapters from application areas illustrating how fundamental concepts and techniques come together to provide elegant solutions to important practical problems. Presents a balanced perspective reflecting the needs of the practitioner. Includes more pages for algorithms and data structures than for purely theoretical issues. Emphasizes practical applications in its discussion of theoretical issues. Contains extensive discussions on string matching, data structures, and finite precision. Provides thorough reporting of B-trees. Focuses on practical algorithms even if they are not asymptotically optimal. Outlines specific applications where algorithmic techniques are of critical importance Algorithms and Theory of Computation Handbook is a comprehensive collection of algorithms and data structures that also covers many theoretical issues. It offers a balanced perspective that reflects the needs of practitioners, including emphasis on applications within discussions on theoretical issues. Chapters include information on finite precision issues as well as discussion of specific algorithms where algorithmic techniques are of special importance, including graph drawing, robotics, forming a VLSI chip, vision and image processing, data compression, and cryptography. The book also presents some advanced topics in combinatorial optimization and parallel/distributed computing. · applications areas where algorithms and data structuring techniques are of special importance · graph drawing · robot algorithms · VLSI layout · vision and image processing algorithms · scheduling · electronic cash · data compression · dynamic graph algorithms · on-line algorithms · multidimensional data structures · cryptography · advanced topics in combinatorial optimization and parallel/distributed computing Unique coverage of Algorithms and Theory of Computation Handbook makes it an essential reference for researchers and practitioners in these applications areas.

16,212

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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