55 if ( idx >= 0 && idx < 10 )
57 return m_bmps[idx].
Clone();
81 virtual void Draw(HDC dc,
int x = 0,
int y = 0)
const
84 ::GetBrushOrgEx(dc, &po);
85 const SIZE& winSize =
m_size;
89 bool isNarrow = (sz.cx * 2 >
m_size.cx);
90 bool isLow = (sz.cy * 2 >
m_size.cy);
94 ::SetRect(&rc, 0, 0, min(sz.cx,
m_size.cx / 2 + 1), min(sz.cy,
m_size.cy / 2 + 1));
95 if ( sz.cx == rc.right && sz.cy == rc.bottom )
97 m_bmps[7].
Draw(dc, 0, 0);
101 m_bmps[7].
Cut(rc).
Draw(dc, 0, 0);
104 ::SetRect(&rc, 0, 0, min(sz.cx,
m_size.cx / 2 + 1), sz.cy);
105 if ( sz.cx == rc.right )
107 m_Draw(dc, m_bmps[1], 0, winSize.cy - sz.cy, winSize);
111 m_Draw(dc, m_bmps[1].Cut(rc), 0, winSize.cy - sz.cy, winSize);
114 ::SetRect(&rc, 0, 0, sz.cx, min(sz.cy,
m_size.cy / 2 + 1));
115 if ( sz.cy == rc.bottom )
117 m_Draw(dc, m_bmps[9], winSize.cx - sz.cx , 0, winSize);
121 m_Draw(dc, m_bmps[9].Cut(rc), winSize.cx - sz.cx , 0, winSize);
124 m_Draw(dc, m_bmps[3], winSize.cx - sz.cx , winSize.cy - sz.cy, winSize);
129 ::SetRect(&rc, sz.cx, 0, winSize.cx - sz.cx, sz.cy);
130 if ( rc.bottom >
m_size.cy / 2 )
132 rc.bottom =
m_size.cy / 2;
134 ::SetBrushOrgEx(dc, po.x, 0, NULL);
137 ::SetRect(&rc, sz.cx, winSize.cy - sz.cy, winSize.cx - sz.cx, winSize.cy);
139 if ( rc.top <
m_size.cy / 2 )
143 ::SetBrushOrgEx(dc, po.x, t, NULL);
149 ::SetRect(&rc, 0, sz.cy, sz.cx, winSize.cy - sz.cy);
150 if ( rc.right >
m_size.cx / 2 )
154 ::SetBrushOrgEx(dc, 0, po.y, NULL);
157 ::SetRect(&rc, winSize.cx - sz.cx, sz.cy, winSize.cx, winSize.cy - sz.cy);
159 if ( rc.left <
m_size.cx / 2 )
163 ::SetBrushOrgEx(dc, t, po.y, NULL);
167 if ( ! isNarrow && ! isLow )
169 ::SetRect(&rc, sz.cx, sz.cy, winSize.cx - sz.cx, winSize.cy - sz.cy);
170 ::SetBrushOrgEx(dc, po.x, po.y, NULL);
177 void m_ApartBitmap(
void)
183 RECT rc = { 0, 0, sz.cx, sz.cy };
184 m_bmps[7] = bi.
Cut(rc);
185 ::OffsetRect(&rc, sz.cx, 0);
186 m_bmps[8] = bi.
Cut(rc);
187 ::OffsetRect(&rc, sz.cx, 0);
188 m_bmps[9] = bi.
Cut(rc);
189 ::SetRect(&rc, 0, sz.cy, sz.cx, sz.cy * 2);
190 m_bmps[4] = bi.
Cut(rc);
191 ::OffsetRect(&rc, sz.cx, 0);
192 m_bmps[5] = bi.
Cut(rc);
193 ::OffsetRect(&rc, sz.cx, 0);
194 m_bmps[6] = bi.
Cut(rc);
195 ::SetRect(&rc, 0, sz.cy * 2, sz.cx, sz.cy * 3);
196 m_bmps[1] = bi.
Cut(rc);
197 ::OffsetRect(&rc, sz.cx, 0);
198 m_bmps[2] = bi.
Cut(rc);
199 ::OffsetRect(&rc, sz.cx, 0);
200 m_bmps[3] = bi.
Cut(rc);
202 void m_Draw(HDC dc,
const CBitmapImage& bi,
int px,
int py,
const SIZE& size)
const
205 RECT rc = { 0, 0, sz.cx, sz.cy };
207 int dx = sz.cx - (size.cx / 2 + 1);
214 int dy = sz.cy - (size.cy / 2 + 1);
CBitmapBorderDrawer(CBitmapHandle bm)
コンストラクタ
virtual void Draw(HDC dc, int x=0, int y=0) const
[描画] 描画.
CBitmapHandle GetParts(int idx) const
[取得] ビットマップ
virtual IDrawable * Clone(void) const
[作成] クローン作成.
bool DrawTile(HDC hdc, const RECT &rect) const
[処理] イメージタイル描画.
CBitmapImage Cut(const RECT &rect, int cx=0, int cy=0) const
[取得] イメージ取り出し.
const SIZE & GetSize(void) const
[取得] イメージサイズ取得.
bool Draw(HDC hdc, int x=0, int y=0) const
[処理] イメージ描画.
CBitmapImage Clone(void) const
[複製] クローン作成