首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GDI矩形的GDI+等价

GDI矩形的GDI+等价
EN

Stack Overflow用户
提问于 2018-11-02 18:03:29
回答 1查看 319关注 0票数 0

GDI GDI+函数的Rectangle等效值是什么?

代码语言:javascript
复制
| Library | Outline       | Fill interior | Both        |
|---------|---------------|---------------|-------------|
| GDI     | FrameRect     | FillRect      | Rectangle   |
| GDI+    | DrawRectangle | FillRectangle | ?           |
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-01-03 14:35:23

GDI+版本的Rectangle

Delphi

代码语言:javascript
复制
class procedure TGDIPlusHelper.Rectangle(g: TGPGraphics; OutlinePen: TGPPen; InteriorFillBrush: TGPBrush; x, y, width, height: Single);
begin
    //GDI has Rectangle.
    //GDI+ we simulate it with FillRectangle followed by DrawRectangle
    g.FillRectangle(InteriorFillBrush, x, y, width, height);
    g.DrawRectangle(OutlinePen, x, y, width, height);
end;

C#

代码语言:javascript
复制
void Rectangle(Graphics g, Pen outlinePen; Brush interiorFillBrush, Single x, Single y, Single width, Single height)
{
    //GDI has Rectangle.
    //GDI+ we simulate it with FillRectangle followed by DrawRectangle
    g.FillRectangle(InteriorFillBrush, x, y, width, height);
    g.DrawRectangle(OutlinePen, x, y, width, height);
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53123718

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档