关于GDI+渐进填充的问题

firebolt2002 2003-10-20 10:26:51
最近要作一个矢量图系统,要求参照OFFICE XP 中WORD的绘图工具来做,但我看了OFFICE的绘图工具,不知道它的填充是怎么实现的,那位大侠知道请指教一下,我对GDI+不熟悉,刚开始用,也希望大家能提供一些这方面的资料,谢谢:)
...全文
55 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
firebolt2002 2003-10-23
  • 打赏
  • 举报
回复
程序做了一半了,发现GDI+的效率实在不高,画的东西多了刷新就会变的非常慢,唉。
功名半纸 2003-10-22
  • 打赏
  • 举报
回复
MS得SDK带得帮助文档有啊!!!!!!!
asett1 2003-10-22
  • 打赏
  • 举报
回复
www.codeproject.com有个gdi+专栏,不过更新也不多,其他的不太清楚了。
asett1 2003-10-21
  • 打赏
  • 举报
回复
Horizontal Linear Gradients
The following example uses a horizontal linear gradient brush to fill a line, an ellipse, and a rectangle:

LinearGradientBrush linGrBrush(
Point(0, 10),
Point(200, 10),
Color(255, 255, 0, 0), // opaque red
Color(255, 0, 0, 255)); // opaque blue

Pen pen(&linGrBrush);

graphics.DrawLine(&pen, 0, 10, 200, 10);
graphics.FillEllipse(&linGrBrush, 0, 30, 200, 100);
graphics.FillRectangle(&linGrBrush, 0, 155, 500, 30);

LinearGradientBrush linGrBrush(
Point(0, 10),
Point(200, 10),
Color(255, 0, 0, 0), // opaque black
Color(255, 255, 0, 0)); // opaque red

REAL relativeIntensities[] = {0.0f, 0.5f, 1.0f};
REAL relativePositions[] = {0.0f, 0.2f, 1.0f};

linGrBrush.SetBlend(relativeIntensities, relativePositions, 3);

graphics.FillEllipse(&linGrBrush, 0, 30, 200, 100);
graphics.FillRectangle(&linGrBrush, 0, 155, 500, 30);
Diagonal Linear Gradients
The gradients in the preceding examples have been horizontal; that is, the color changes gradually as you move along any horizontal line. You can also define vertical gradients and diagonal gradients. The following code passes the points (0, 0) and (200, 100) to a LinearGradientBrush constructor. The color blue is associated with (0, 0), and the color green is associated with (200, 100). A line (with pen width 10) and an ellipse are filled with the linear gradient brush.

LinearGradientBrush linGrBrush(
Point(0, 0),
Point(200, 100),
Color(255, 0, 0, 255), // opaque blue
Color(255, 0, 255, 0)); // opaque green

Pen pen(&linGrBrush, 10);

graphics.DrawLine(&pen, 0, 0, 600, 300);
graphics.FillEllipse(&linGrBrush, 10, 100, 200, 100);
firebolt2002 2003-10-21
  • 打赏
  • 举报
回复
谢谢,有什么讨论GDI+的BBS或网站么?

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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