## GDI+ 学习记录(12): 矩形 - Rectangle、Rectangles 转

涂孟超

``````//填充与描边
var
g: TGPGraphics;
p: TGPPen;
sb: TGPSolidBrush;
begin
g := TGPGraphics.Create(Canvas.Handle);
sb := TGPSolidBrush.Create(MakeColor(255,255,255));
p := TGPPen.Create(MakeColor(255,0,0),6);

g.FillRectangle(sb, 0, 0, Self.ClientWidth, Self.ClientHeight); {填充窗体矩形}
g.DrawRectangle(p,11,11,111,111);                               {矩形描边}
sb.SetColor(MakeColor(255,255,0));
g.FillRectangle(sb,11,11,111,111);                              {填充矩形}

p.Free;
sb.Free;
g.Free;
end;

//矩形组
var
g: TGPGraphics;
p: TGPPen;
sb: TGPSolidBrush;
rs: array[0..1] of TGPRect;
begin
g := TGPGraphics.Create(Canvas.Handle);
sb := TGPSolidBrush.Create(MakeColor(255,255,255));
p := TGPPen.Create(MakeColor(255,0,0),2);

rs[0].X := 11; rs[0].Y := 11; rs[0].Width := 88; rs[0].Height := 111;
rs[1].X := 111; rs[1].Y := 122; rs[1].Width := 88; rs[1].Height := 111;

g.DrawRectangles(p, PGPRect(@rs), Length(rs));
g.FillRectangles(sb, PGPRect(@rs), Length(rs));

p.Free;
sb.Free;
g.Free;
end;

``````

### 涂孟超

Leetcode 223. Rectangle Area

Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom left corner and top right corner as shown in the figure. 思路： ......

ShutLove
2017/12/05
0
0
LeetCode：Rectangle Area - 矩形交叉部分的面积

1、题目名称 Rectangle Area（矩形交叉部分的面积） 2、题目地址 https://leetcode.com/problems/rectangle-area/ 3、题目内容 英文：Find the total area covered by two rectilinear rect...

2015/09/01
671
0

2017/12/29
0
0
169. Why tables and classes are so useful @Ignatz

from:http://coolcodea.wordpress.com/2014/10/01/169-why-tables-and-classes-are-so-useful/ cache: http://cc.bingj.com/cache.aspx?q=169-why-tables-and-classes-are-so-useful&d=47736......

FreeBlues
2014/10/09
0
0

06/26
0
0

12分钟前
0
0

18分钟前
0
0
tomcat线程模型

Connector结构 BIO模式 NIO模式

grace_233
58分钟前
2
0
Javascript

59分钟前
1
0

Linux就该这么学

3
0