6#include "helper/SDIBHelper.h"
7#include <core/SGradient.h>
16 , m_filterLevel(kUndef_FilterLevel)
45 __baseCls::OnInitFinished(xmlNode);
46 if (!m_bLazyLoad && !m_strSrc.IsEmpty())
48 m_pImg.Attach(LOADIMAGE2(m_strSrc));
57 RECT rcSrc = { 0, 0, sz.cx, sz.cy };
59 OffsetRect(&rcSrc, 0, iState * sz.cy);
61 OffsetRect(&rcSrc, iState * sz.cx, 0);
68 return MAKELONG(m_bTile ? EM_TILE : EM_STRETCH, m_filterLevel);
70 return MAKELONG(EM_NULL, m_filterLevel);
81 m_pImg.Attach(LOADIMAGE2(m_strSrc));
98 if (m_bLazyLoad && !m_strSrc.IsEmpty())
100 m_pImg.Attach(LOADIMAGE2(m_strSrc));
108 if (!m_bEnableColorize)
110 if (cr == m_crColorize)
117 LPCVOID pSrc = m_imgBackup->GetPixelBits();
119 memcpy(pDst, pSrc, pImg->
Width() * pImg->
Height() * 4);
126 if (S_OK != pImg->
Clone(&m_imgBackup))
138 __baseCls::_Scale(skinObj, nScale);
140 pRet->m_nStates = m_nStates;
141 pRet->m_bTile = m_bTile;
142 pRet->m_bVertical = m_bVertical;
143 pRet->m_filterLevel = m_filterLevel;
144 pRet->m_bAutoFit = m_bAutoFit;
145 pRet->m_state2Index = m_state2Index;
146 pRet->m_bLazyLoad = FALSE;
149 szSkin.cx = MulDiv(szSkin.cx, nScale,
GetScale());
150 szSkin.cy = MulDiv(szSkin.cy, nScale,
GetScale());
153 szSkin.cy *= m_nStates;
157 szSkin.cx *= m_nStates;
162 m_imgBackup->Scale2(&pRet->m_imgBackup, szSkin.cx, szSkin.cy, kHigh_FilterLevel);
167 m_pImg->Scale2(&pRet->m_pImg, szSkin.cx, szSkin.cy, kHigh_FilterLevel);
176 CRect rcTarget = *rcDraw;
178 pt.x = rcTarget.left + (rcTarget.Width() - szSkin.cx) / 2;
179 pt.y = rcTarget.top + (rcTarget.Height() - szSkin.cy) / 2;
181 rcTarget = CRect(pt, szSkin);
183 RECT rcSrc = { 0, 0, szSkin.cx, szSkin.cy };
185 OffsetRect(&rcSrc, 0, iState * szSkin.cy);
187 OffsetRect(&rcSrc, iState * szSkin.cx, 0);
205 pt.y = sz.cy * iState;
207 pt.x = sz.cx * iState;
208 CRect rcSour(pt, sz);
214 return MAKELONG(m_bTile ? EM_TILE : EM_STRETCH, m_filterLevel);
222 pClone->m_rcMargin.left = MulDiv(m_rcMargin.left, nScale, nSrcScale);
223 pClone->m_rcMargin.top = MulDiv(m_rcMargin.top, nScale, nSrcScale);
224 pClone->m_rcMargin.right = MulDiv(m_rcMargin.right, nScale, nSrcScale);
225 pClone->m_rcMargin.bottom = MulDiv(m_rcMargin.bottom, nScale, nSrcScale);
232 , m_fCornerPercent(0.0)
234 m_colors.m_crBorder[0] = RGB(0x70, 0x70, 0x70);
235 m_colors.m_crBorder[1] = CR_INVALID;
236 m_colors.m_crBorder[2] = CR_INVALID;
237 m_colors.m_crBorder[3] = CR_INVALID;
239 m_colors.m_crUp[0] = (RGB(0xEE, 0xEE, 0xEE));
240 m_colors.m_crDown[0] = (RGB(0xD6, 0xD6, 0xD6));
241 m_colors.m_crUp[1] = (RGB(0xEE, 0xEE, 0xEE));
242 m_colors.m_crDown[1] = (RGB(0xE0, 0xE0, 0xE0));
243 m_colors.m_crUp[2] = (RGB(0xCE, 0xCE, 0xCE));
244 m_colors.m_crDown[2] = (RGB(0xC0, 0xC0, 0xC0));
245 m_colors.m_crUp[3] = (RGB(0x8E, 0x8E, 0x8E));
246 m_colors.m_crDown[3] = (RGB(0x80, 0x80, 0x80));
251 int nCorner = m_nCornerRadius;
252 if (m_fCornerPercent > 0.0)
254 int nW = prcDraw->right - prcDraw->left;
255 int nH = prcDraw->bottom - prcDraw->top;
256 nCorner = (nW < nH) ? (
int)(nW * m_fCornerPercent) : (int)(nH * m_fCornerPercent);
259 if (m_colors.m_crUp[iState] != m_colors.m_crDown[iState])
261 CRect rcDraw = *prcDraw;
262 rcDraw.DeflateRect(1, 1);
263 CPoint ptCorner(nCorner, nCorner);
264 GradientItem gradients[2] = { m_colors.m_crUp[iState], 0.0f, m_colors.m_crDown[iState], 1.0f };
269 SColor cr(m_colors.m_crDown[iState]);
277 if (CR_INVALID == m_colors.m_crBorder[iState])
281 pRT->
CreatePen(PS_SOLID, m_colors.m_crBorder[iState], 1, &pPen);
294 memcpy(m_colors.m_crUp, crUp, 4 *
sizeof(COLORREF));
295 memcpy(m_colors.m_crDown, crDown, 4 *
sizeof(COLORREF));
296 memcpy(m_colors.m_crBorder, crBorder, 4 *
sizeof(COLORREF));
301 if (!m_bEnableColorize)
303 if (m_crColorize == cr)
307 memcpy(&m_colors, &m_colorsBackup,
sizeof(BTNCOLORS));
312 if (m_crColorize != 0)
314 memcpy(&m_colors, &m_colorsBackup,
sizeof(BTNCOLORS));
318 memcpy(&m_colorsBackup, &m_colors,
sizeof(BTNCOLORS));
323 for (
int i = 0; i < 4; i++)
341 , m_crFrom(CR_INVALID)
348 GradientItem gradients[2] = { m_crFrom, 0.0f, m_crTo, 1.0f };
363 m_centerX = m_centerY = 0.5f;
364 m_radius.setInvalid();
365 m_ratio_radius = 0.5f;
380 if (m_radius.isValid())
381 ret.radial.radius = (float)m_radius.toPixelSize(nScale);
383 ret.radial.radius = m_ratio_radius * smax(wid, hei);
384 ret.sweep.centerX = m_centerX;
385 ret.sweep.centerY = m_centerY;
388 ret.sweep.centerX = m_centerX;
389 ret.sweep.centerY = m_centerY;
390 ret.sweep.bFullArc = m_bFullArc;
399 m_ptCorner = SPoint::Make(0.f, 0.f);
400 m_szCorner[0].setInvalid();
401 m_szCorner[1].setInvalid();
402 m_bEnableScale =
false;
410 if (m_szCorner[0].isValid() && m_szCorner[1].isValid())
412 ptCorner.x = m_szCorner[0].toPixelSize(
GetScale());
413 ptCorner.y = m_szCorner[1].toPixelSize(
GetScale());
417 ptCorner.x = (int)(rc.Width() / 2 * m_ptCorner.fX);
418 ptCorner.y = (int)(rc.Height() / 2 * m_ptCorner.fY);
420 GradientInfo info =
GetGradientInfo(
GetScale(), prcDraw->right - prcDraw->left, prcDraw->bottom - prcDraw->top);
421 pRT->
DrawGradientRectEx(prcDraw, ptCorner, m_gradient->GetGradientData(), m_gradient->GetGradientLength(), &info,
GetAlpha());
438 , m_bHasGripper(FALSE)
439 , m_bHasInactive(FALSE)
446 CSize szFrame(sz.cx / 9, sz.cx / 9);
449 return CRect(CPoint(szFrame.cx * 8, 0), szFrame);
453 return CRect(CPoint(szFrame.cx * 8, (1 + (bVertical ? 0 : 1)) * szFrame.cy), szFrame);
457 if (nState == SBST_INACTIVE && !m_bHasInactive)
459 nState = SBST_NORMAL;
482 return CRect(CPoint(szFrame.cx * iPart, szFrame.cy * nState), szFrame);
490 int nSbCode = LOWORD(dwState);
491 int nState = LOBYTE(HIWORD(dwState));
492 BOOL bVertical = HIBYTE(HIWORD(dwState));
493 CRect rcMargin(0, 0, 0, 0);
495 rcMargin.top = m_nMargin, rcMargin.bottom = m_nMargin;
497 rcMargin.left = m_nMargin, rcMargin.right = m_nMargin;
499 CRect rcSour =
GetPartRect(nSbCode, nState, bVertical);
503 if (nSbCode == SB_THUMBTRACK && m_bHasGripper)
506 CRect rcDraw = *prcDraw;
509 rcDraw.top += (rcDraw.Height() - rcSour.Height()) / 2, rcDraw.bottom = rcDraw.top + rcSour.Height();
511 rcDraw.left += (rcDraw.Width() - rcSour.Width()) / 2, rcDraw.right = rcDraw.left + rcSour.Width();
518 __baseCls::_Scale(skinObj, nScale);
521 pRet->m_nMargin = MulDiv(m_nMargin, nScale,
GetScale());
522 pRet->m_bHasInactive = m_bHasInactive;
523 pRet->m_bHasGripper = m_bHasGripper;
537 , m_fCornerPercent(0.0)
540 m_crStates[0] = RGBA(255, 255, 255, 255);
541 m_crStates[1] = CR_INVALID;
542 m_crStates[2] = CR_INVALID;
543 m_crStates[3] = CR_INVALID;
544 m_crBorders[0] = m_crBorders[1] = m_crBorders[2] = m_crBorders[3] = CR_INVALID;
556 int nCorner = m_nRadius;
557 if (m_fCornerPercent > 0.0)
559 int nW = prcDraw->right - prcDraw->left;
560 int nH = prcDraw->bottom - prcDraw->top;
561 nCorner = (nW < nH) ? (
int)(nW * m_fCornerPercent) : (int)(nH * m_fCornerPercent);
563 int iBgColor = iState;
564 if (m_crStates[iBgColor] == CR_INVALID)
566 if (m_crStates[iBgColor] != CR_INVALID)
568 SColor cr(m_crStates[iBgColor]);
575 int iBorderColor = iState;
576 if (m_crBorders[iBorderColor] == CR_INVALID)
578 if (m_crBorders[iBorderColor] != CR_INVALID && m_nBorderWidth > 0)
581 pRT->
CreatePen(PS_SOLID, m_crBorders[iBorderColor], m_nBorderWidth, (
IPenS **)&pen);
594 for (
int i = 3; i >= 0; i--)
596 if (m_crStates[i] == CR_INVALID)
611SSkinShape::SSkinShape()
616void SSkinShape::OnInitFinished(
IXmlNode *pNode)
618 __baseCls::OnInitFinished(pNode);
619 SXmlNode xmlNode(pNode);
620 SXmlNode xmlSolid = xmlNode.child(SShapeSolid::GetClassName());
624 m_solid.Attach(
new SShapeSolid());
625 m_solid->InitFromXml(&xmlSolid);
627 SXmlNode xmlBitmap = xmlNode.child(SShapeBitmap::GetClassName());
631 m_bitmap.Attach(
new SShapeBitmap());
632 m_bitmap->InitFromXml(&xmlBitmap);
635 SXmlNode xmlGrident = xmlNode.child(SGradientBrush::GetClassName());
639 m_gradient.Attach(
new SGradientBrush());
640 m_gradient->InitFromXml(&xmlGrident);
642 SXmlNode xmlSize = xmlNode.child(SShapeSize::GetClassName());
646 m_shapeSize.Attach(
new SShapeSize());
647 m_shapeSize->InitFromXml(&xmlSize);
649 SXmlNode xmlStoke = xmlNode.child(SStroke::GetClassName());
653 m_stroke.Attach(
new SStroke());
654 m_stroke->InitFromXml(&xmlStoke);
656 SXmlNode xmlConner = xmlNode.child(SCornerSize::GetClassName());
660 m_cornerSize.Attach(
new SCornerSize());
661 m_cornerSize->InitFromXml(&xmlConner);
663 SXmlNode xmlRatioConner = xmlNode.child(SRatioCornerSize::GetClassName());
666 if (!m_ratioCornerSize)
667 m_ratioCornerSize.Attach(
new SRatioCornerSize());
668 m_ratioCornerSize->InitFromXml(&xmlRatioConner);
671 SXmlNode xmlRing = xmlNode.child(SShapeRing::GetClassName());
675 m_ringParam.Attach(
new SShapeRing());
676 m_ringParam->InitFromXml(&xmlRing);
680void SSkinShape::_Scale(
ISkinObj *pObj,
int nScale)
682 __baseCls::_Scale(pObj, nScale);
684 SSkinShape *pRet = sobj_cast<SSkinShape>(pObj);
686 pRet->m_solid = m_solid;
687 pRet->m_bitmap = m_bitmap;
688 pRet->m_gradient = m_gradient;
689 pRet->m_shape = m_shape;
690 pRet->m_shapeSize = m_shapeSize;
691 pRet->m_cornerSize = m_cornerSize;
692 pRet->m_stroke = m_stroke;
693 pRet->m_ringParam = m_ringParam;
696SIZE SSkinShape::GetSkinSize()
const
701 return CSize(m_shapeSize->m_width.toPixelSize(
GetScale()), m_shapeSize->m_height.toPixelSize(
GetScale()));
704void SSkinShape::_DrawByIndex(
IRenderTarget *pRT, LPCRECT rcDraw,
int iState, BYTE byAlpha)
const
706 CRect rcDest(rcDraw);
707 SAutoRefPtr<IBrushS> pBrush, oldBrush;
710 pBrush.
Attach(m_solid->CreateBrush(pRT, byAlpha));
712 else if (m_gradient != NULL)
714 pBrush.
Attach(m_gradient->CreateBrush(pRT,
GetScale(), byAlpha, rcDraw->right - rcDraw->left, rcDraw->bottom - rcDraw->top));
718 pBrush.
Attach(m_bitmap->CreateBrush(pRT, byAlpha));
721 SAutoRefPtr<IPenS> pPen, oldPen;
722 if (m_stroke != NULL)
724 int nPenWidth = m_stroke->m_width.toPixelSize(
GetScale());
725 SColor color(m_stroke->m_color, byAlpha);
726 pRT->
CreatePen(m_stroke->GetStyle(), color.toCOLORREF(), nPenWidth, &pPen);
727 rcDest.DeflateRect(nPenWidth / 2, nPenWidth / 2);
730 CPoint ptCorner = GetCornerSize(rcDest);
737 if (ptCorner.x != 0 || ptCorner.y != 0)
751 ptCorner = GetCornerSize(rcDest);
755 if (ptCorner.x != 0 || ptCorner.y != 0)
765 POINT ptCenter = { (rcDest.left + rcDest.right) / 2, (rcDest.top + rcDest.bottom) / 2 };
766 int nRadius = smin(rcDest.right - rcDest.left, rcDest.bottom - rcDest.top) / 2;
767 RECT rcRing = { ptCenter.x - nRadius, ptCenter.y - nRadius, ptCenter.x + nRadius, ptCenter.y + nRadius };
768 float startAngle = 0;
769 float endAngle = 360;
772 startAngle = m_ringParam->m_startAngle;
773 endAngle = m_ringParam->m_sweepAngle;
775 pRT->
DrawArc(&rcRing, startAngle, endAngle,
false);
783int SSkinShape::GetStates()
const
788POINT SSkinShape::GetCornerSize(
const CRect &rc)
const
791 return m_cornerSize->GetConner(
GetScale());
792 if (m_ratioCornerSize)
793 return m_ratioCornerSize->GetConner(rc);
797SSkinShape::SStroke::SStroke()
798 : m_color(CR_INVALID)
805int SSkinShape::SStroke::GetStyle()
const
807 int ret = m_style | m_endStyle | m_joinStyle;
808 if (m_endStyle || m_joinStyle)
815IBrushS *SSkinShape::SShapeSolid::CreateBrush(IRenderTarget *pRT, BYTE byAlpha)
817 if (m_crSolid == CR_INVALID)
819 SColor color(m_crSolid, byAlpha);
825IBrushS *SSkinShape::SShapeBitmap::CreateBrush(IRenderTarget *pRT, BYTE byAlpha)
834IBrushS *SSkinShape::SGradientBrush::CreateBrush(IRenderTarget *pRT,
int nScale, BYTE byAlpha,
int wid,
int hei)
const
836 if (m_gradient->GetGradientLength() < 2)
839 GradientInfo info = GetGradientInfo(nScale, wid, hei);
840 pRT->
CreateGradientBrush(m_gradient->GetGradientData(), m_gradient->GetGradientLength(), &info, byAlpha, kRepeat_TileMode, &ret);
844void SSkinShape::SGradientBrush::OnInitFinished(THIS_ IXmlNode *xmlNode)
846 m_gradient->OnInitFinished(xmlNode);
849HRESULT SSkinShape::SCornerSize::OnAttrRadius(
const SStringW strValue, BOOL bLoading)
852 size_t nValues = SplitString(strValue, L
',', values);
855 m_radiusX = m_radiusY = GETLAYOUTSIZE(values[0]);
858 else if (nValues == 2)
860 m_radiusX = GETLAYOUTSIZE(values[0]);
861 m_radiusY = GETLAYOUTSIZE(values[1]);
867HRESULT SSkinShape::SRatioCornerSize::OnAttrRadius(
const SStringW strValue, BOOL bLoading)
870 size_t nValues = SplitString(strValue, L
',', values);
873 swscanf_s(strValue.
c_str(), L
"%f", &m_radius.fX);
874 m_radius.fY = m_radius.fX;
877 else if (nValues == 2)
879 swscanf_s(values[0].c_str(), L
"%f", &m_radius.fX);
880 swscanf_s(values[1].c_str(), L
"%f", &m_radius.fY);
908 return m_skins[i]->GetSkinSize();
915 __baseCls::_Scale(skinObj, nScale);
916 SSKinGroup *pRet = sobj_cast<SSKinGroup>(skinObj);
917 for (
int i = 0; i < ARRAYSIZE(m_skins); i++)
921 pRet->m_skins[i].
Attach(m_skins[i]->
Scale(nScale));
930 IBitmapS *pImg = LOADIMAGE2(strValue);
933 int nWid = pImg->
Width();
934 int nHei = pImg->
Height();
935 if (nWid < 2 || nHei < 2)
939 int left, right, top, bottom;
943 while (i < nWid - 1 && p[3] == 0)
947 while (i < nWid - 1 && p[3] != 0)
953 p = pBuf + (nWid * 4);
954 while (i < nHei - 1 && p[3] == 0)
957 while (i < nHei - 1 && p[3] != 0)
961 m_rcMargin.left = left;
962 m_rcMargin.right = nWid - 2 - right;
963 m_rcMargin.top = top;
964 m_rcMargin.bottom = nHei - 2 - bottom;
970 return E_OUTOFMEMORY;
972 hRet = pImgCenter->
Init(nWid - 2, nHei - 2, NULL);
979 LPBYTE pSrc = pBuf + (nWid * 4);
986 memcpy(pDst, pSrc, (nWid - 2) * 4);
987 pDst += (nWid - 2) * 4;
#define SB_CORNOR
Constant for scrollbar corner.
#define SB_THUMBGRIPPER
Constant for scrollbar thumb gripper.
Smart pointer class for managing COM-style reference-counted objects.
void Attach(T *p2)
Attaches to an existing object without adding a reference.
const COLORREF toCOLORREF() const
将颜色转换为COLORREF格式
void updateAlpha(BYTE alpha)
更新颜色的Alpha值
static bool Colorize(IBitmapS *pBmp, COLORREF crRef)
对位图进行着色处理
SGradientDesc()
Constructor for SGradientDesc.
GradientInfo GetGradientInfo(int nScale, int wid, int hei) const
Gets the gradient information.
Gradient management class.
Represents a group of skins for different states.
void _DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const override
Draws the skin group by index.
int GetStates() SCONST OVERRIDE
Gets the number of states supported by the skin group.
SIZE GetSkinSize() SCONST OVERRIDE
Gets the size of the skin group.
void _Scale(ISkinObj *skinObj, int nScale) override
Scales the skin group.
virtual ~SSkinColorRect()
Destructor for SSkinColorRect.
SSkinColorRect()
Constructor for SSkinColorRect.
void _DrawByIndex(IRenderTarget *pRT, LPCRECT prcDraw, int iState, BYTE byAlpha) const override
Draws the skin by index.
ISkinObj * Scale(int nScale) OVERRIDE
Scales the skin.
int GetStates() SCONST OVERRIDE
Gets the number of states in the skin.
void _DrawByIndex(IRenderTarget *pRT, LPCRECT prcDraw, int iState, BYTE byAlpha) const override
Draws the skin by index.
ISkinObj * Scale(int nScale) OVERRIDE
Scales the skin.
SSkinGradation2()
Constructor for SSkinGradation2.
void OnInitFinished(IXmlNode *xmlNode) OVERRIDE
Called when initialization is finished.
void _DrawByIndex(IRenderTarget *pRT, LPCRECT prcDraw, int iState, BYTE byAlpha) const override
Draws the skin by index.
SSkinGradation()
Constructor for SSkinGradation.
ISkinObj * Scale(int nScale) OVERRIDE
Scales the skin.
void _DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const override
Draws the skin by index.
HRESULT OnAttrSrc(const SStringW &strValue, BOOL bLoading)
Handles the 'src' attribute.
SSkinImgFrame()
Constructor for SSkinImgFrame.
void _Scale(ISkinObj *skinObj, int nScale) override
Scales the skin.
void _DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const override
Draws the skin by index.
UINT GetExpandMode() const override
Gets the expand mode for the skin.
void _Scale(ISkinObj *skinObj, int nScale) override
Scales the skin.
virtual ~SSkinImgList()
Destructor for SSkinImgList.
virtual bool SetImage(IBitmapS *pImg)
Sets the image for the skin.
SIZE GetSkinSize() SCONST OVERRIDE
Gets the size of the skin.
HRESULT OnAttrSrc(const SStringW &value, BOOL bLoading)
Handles the 'src' attribute.
void OnInitFinished(IXmlNode *pNode) OVERRIDE
Called when initialization is finished.
virtual BOOL IsVertical() const
Checks if the images are arranged vertically.
SSkinImgList()
Constructor for SSkinImgList.
void OnColorize(COLORREF cr) OVERRIDE
Handles colorization of the skin.
void _DrawByIndex(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) const override
Draws the skin by index.
int GetStates() SCONST OVERRIDE
Gets the number of states in the skin.
virtual UINT GetExpandMode() const
Gets the expand mode for the skin.
virtual IBitmapS * GetImage() const
Gets the image used by the skin.
int GetScale() SCONST OVERRIDE
Gets the scale factor of the skin.
BYTE GetAlpha() SCONST OVERRIDE
Gets the alpha value of the skin.
ISkinObj * Scale(int nScale) OVERRIDE
Scales the skin.
A class representing an ASCII string.
const wchar_t * c_str() SCONST
Retrieves a C-style string representation of the string.
int ReplaceChar(wchar_t chOld, wchar_t chNew)
Replaces all occurrences of a character with another character.
IRenderFactory * GetRenderFactory() SCONST PURE
Obtains the render factory that created this rendering object.
UINT Height() SCONST PURE
Retrieves the height of the bitmap.
SIZE Size() SCONST PURE
Retrieves the size of the bitmap.
UINT Width() SCONST PURE
Retrieves the width of the bitmap.
HRESULT Init(int nWid, int nHei, const LPVOID pBits) PURE
Initializes the bitmap from 32-bit bitmap data.
HRESULT Clone(IBitmapS **ppClone) SCONST PURE
Clones the bitmap.
long Release() PURE
Decrements the reference count for the object.
LPVOID LockPixelBits() PURE
Locks the pixel bits of the bitmap for writing.
void UnlockPixelBits(LPVOID pBuf) PURE
Unlocks the pixel bits of the bitmap.
BOOL CreateBitmap(IBitmapS **ppBitmap) PURE
Creates a bitmap object.
Base class for all renderable objects.
Interface for rendering target objects.
HRESULT DrawRectangle(LPCRECT pRect) PURE
Draw a rectangle outline.
HRESULT FillSolidRoundRect(LPCRECT pRect, POINT pt, COLORREF cr) PURE
Fill a rounded rectangle with a solid color.
HRESULT DrawEllipse(LPCRECT pRect) PURE
Draw an ellipse outline.
HRESULT FillEllipse(LPCRECT pRect) PURE
Fill an ellipse with the current brush.
HRESULT DrawBitmapEx(LPCRECT pRcDest, const IBitmapS *pBitmap, LPCRECT pRcSrc, UINT expendMode, BYTE byAlpha=0xFF) PURE
Draws a bitmap with expansion mode.
HRESULT DrawArc(LPCRECT pRect, float startAngle, float sweepAngle, BOOL useCenter) PURE
Draw an arc.
HRESULT CreateGradientBrush(const GradientItem *pGradients, int nCount, const GradientInfo *info, BYTE byAlpha, TileMode tileMode, IBrushS **ppBrush) PURE
Create a gradient brush.
HRESULT DrawGradientRectEx(LPCRECT pRect, POINT ptRoundCorner, const GradientItem *pGradients, int nCount, const GradientInfo *info, BYTE byAlpha=0xFF) PURE
Draw an extended gradient-filled rectangle.
HRESULT CreateBitmapBrush(IBitmapS *pBmp, TileMode xtm, TileMode ytm, IBrushS **ppBrush) PURE
Create a bitmap brush.
HRESULT SelectObject(IRenderObj *pObj, IRenderObj **pOldObj=NULL) PURE
Selects a new rendering object and optionally retrieves the previous one.
HRESULT CreateSolidColorBrush(COLORREF cr, IBrushS **ppBrush) PURE
Create a solid color brush.
HRESULT CreatePen(int iStyle, COLORREF cr, int cWidth, IPenS **ppPen) PURE
Create a pen object.
HRESULT FillSolidRect(LPCRECT pRect, COLORREF cr) PURE
Fill a rectangle with a solid color.
HRESULT FillRectangle(LPCRECT pRect) PURE
Fill a rectangle with the current brush.
HRESULT DrawBitmap9Patch(LPCRECT pRcDest, const IBitmapS *pBitmap, LPCRECT pRcSrc, LPCRECT pRcSourMargin, UINT expendMode, BYTE byAlpha=0xFF) PURE
Draws a 9-patch bitmap.
HRESULT DrawRoundRect(LPCRECT pRect, POINT pt) PURE
Draw a rounded rectangle outline.
HRESULT FillRoundRect(LPCRECT pRect, POINT pt) PURE
Fill a rounded rectangle with the current brush.
HRESULT DrawGradientRect(LPCRECT pRect, BOOL bVert, POINT ptRoundCorner, const GradientItem *pGradients, int nCount, BYTE byAlpha=0xFF) PURE
Draw a gradient-filled rectangle.
Interface for Skin Objects.
void DrawByIndex2(IRenderTarget *pRT, LPCRECT rcDraw, int iState, BYTE byAlpha) SCONST PURE
Draws the skin object to the specified render target with a given index and transparency.
void OnInitFinished(IXmlNode *xmlNode) PURE
Handles the completion of attribute initialization.