本文整理汇总了C++中SPtr::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ SPtr::Get方法的具体用法?C++ SPtr::Get怎么用?C++ SPtr::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPtr
的用法示例。
在下文中一共展示了SPtr::Get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawBackGround
HRESULT UIBookMenuDlg::DrawBackGround(DK_IMAGE _drawingImg)
{
HRESULT hr(S_OK);
DK_IMAGE imgSelf;
DK_RECT rcSelf={0, 0, m_iWidth, m_iHeight};
RTN_HR_IF_FAILED(CropImage(
_drawingImg,
rcSelf,
&imgSelf));
CTpGraphics grp(imgSelf);
SPtr<ITpImage> spImg = ImageManager::GetImage(IMAGE_MENU_BACK);
if (spImg)
{
RTN_HR_IF_FAILED(grp.DrawImageStretchBlend(spImg.Get(), 0, 0, m_iWidth, m_iHeight));
}
return S_OK;
}
示例2: DrawBackGround
HRESULT UIWifiListItem::DrawBackGround(DK_IMAGE drawingImg)
{
HRESULT hr(S_OK);
CTpGraphics grf(drawingImg);
RTN_HR_IF_FAILED(grf.EraserBackGround());
SPtr<ITpImage> pimgSignalAP = ImageManager::GetImage(IMAGE_TOUCH_ICON_WIFI_LEVEL);
const int width = pimgSignalAP->GetWidth();
const int height = pimgSignalAP->GetHeight()/5;
const int top = m_fIsProtected ? m_pProtecedAPImg->GetY() : (m_iHeight - height) >> 1;
RTN_HR_IF_FAILED(grf.DrawImageBlend(pimgSignalAP.Get(),
m_iLeft + m_iWidth - pimgSignalAP->GetWidth(),
top,
0,
height * (m_iQualityLv - 1),
width,
height));
RTN_HR_IF_FAILED(grf.DrawLine(m_pSSIDLabel->GetX(), m_iHeight - 1, m_iWidth - m_pSSIDLabel->GetX(), 1, DOTTED_STROKE));
return hr;
}
示例3: Draw
HRESULT UITextBox::Draw(DK_IMAGE image)
{
//初始化绘图工具
if (!m_bIsVisible)
{
return S_OK;
}
if (image.pbData == NULL)
{
return E_FAIL;
}
HRESULT hr(S_OK);
DK_IMAGE img1;
DK_RECT rect={m_iLeft, m_iTop, m_iLeft + m_iWidth, m_iTop + m_iHeight};
RTN_HR_IF_FAILED(CropImage(image,rect,&img1));
CTpGraphics g1(img1);//主要画布
RTN_HR_IF_FAILED(g1.EraserBackGround());
//背景图边框
int iLeft = 0, iTop = 0;
if (m_showBorder)
{
#ifdef KINDLE_FOR_TOUCH
RTN_HR_IF_FAILED(UIUtility::DrawBorder(img1, 0, 0, 0, 0, 0, true, true));
#else
SPtr<ITpImage> spImg = ImageManager::GetImage(IMAGE_TEXTBOX_BACK);
if (spImg)
{
g1.DrawImageStretchBlend(spImg.Get(), iLeft, iTop, m_iWidth, m_iHeight,1,10);
}
#endif
}
ITpImage* pImage = m_spImage.Get();
if (IsFocus() && m_spFocusedImage)
{
pImage = m_spFocusedImage.Get();
}
if (pImage)
{
int iLeftOffset = (m_iHeight > pImage->GetHeight()) ? (m_iHeight - pImage->GetHeight()) >> 1 : 0;
int iTopOffset = (m_iHeight > pImage->GetWidth()) ? (m_iHeight - pImage->GetWidth()) >> 1 : 0;
iLeft += iLeftOffset;
iTop += iTopOffset;
g1.DrawImageBlend(pImage, iLeft, iTop, 0, 0, pImage->GetWidth(), pImage->GetHeight());
iLeft += pImage->GetWidth() + iLeftOffset;
}
//画字
if(m_iDataLen > 0)
{
DK_IMAGE imgDrawChar;
DK_RECT rcDrawChar={m_iLeft + m_nMarginLeft + m_nBorderLinePixel + iLeft,
m_iTop + m_nMarginTop + m_nBorderLinePixel,
m_iLeft + m_iWidth - m_nBorderLinePixel,
m_iTop + m_iHeight - m_nMarginBottom - m_nBorderLinePixel };
HRESULT hr(S_OK);
RTN_HR_IF_FAILED(CropImage(
image,
rcDrawChar,
&imgDrawChar
));
if(!imgDrawChar.pbData)
{
return E_FAIL;
}
CTpGraphics g2(imgDrawChar);//绘字画布
wchar_t wcharTmp[TEXTBOX_DATA_MAX_LEN];
if (m_echoMode == Normal)
{
memcpy(wcharTmp , m_strData + m_iStartIndex , (m_iEndIndex - m_iStartIndex + 1) * sizeof(wcharTmp[0]));
}
else if (m_echoMode == Password || m_echoMode == PasswordEchoOnEdit)
{
memcpy(wcharTmp , m_strEchoData + m_iStartIndex , (m_iEndIndex - m_iStartIndex + 1) * sizeof(wcharTmp[0]));
}
wcharTmp[m_iEndIndex - m_iStartIndex + 1]=0;
if(m_fIsSelectAll && m_bIsFocus)
{
m_iFontColor = ColorManager::knWhite;
}
else if (!IsEnable())
{
m_iFontColor = ColorManager::GetColor(COLOR_SCROLLBAR_BACK);
}
else
{
m_iFontColor = ColorManager::knBlack;
}
ITpFont* pFont = FontManager::GetInstance()->GetFont(m_ifontAttr, m_iFontColor);
if (pFont)
{
const int maxTxtHeight = (m_iHeight -(m_nBorderLinePixel * 2 + m_nMarginTop + m_nMarginBottom));
const int iTxtTop = (maxTxtHeight > pFont->GetHeight()) ? ((maxTxtHeight - pFont->GetHeight()) >> 1) : 0;
//.........这里部分代码省略.........
示例4: Draw
HRESULT UIPdfTrimColumnedDlg::Draw(DK_IMAGE drawingImg)
{
DebugPrintf(DLC_ZHY,"enter %s::%s,%s(%d)",GetClassName(), __FUNCTION__, __FILE__, __LINE__);
if (!IsVisible())
return S_OK;
HRESULT hr(S_OK);
CTpGraphics grf(drawingImg);
DK_IMAGE imgSelf;
DK_RECT rcSelf={m_iLeft, m_iTop, m_iLeft + m_iWidth, m_iTop + m_iHeight};
RTN_HR_IF_FAILED(CropImage(drawingImg, rcSelf, &imgSelf));
RTN_HR_IF_FAILED(DrawBackGround(imgSelf));
//draw flag
SPtr<ITpImage> spImageCursor = ImageManager::GetImage(IMAGE_PDF_LOCATE_CURSOR);
int w = spImageCursor->GetWidth();
int h = spImageCursor->GetHeight();
if (m_bIsActionFinished)
{
m_btnConfirmed.SetVisible(true);
m_btnCancel.SetVisible(true);
RTN_HR_IF_FAILED(m_btnConfirmed.Draw(imgSelf));
RTN_HR_IF_FAILED(m_btnCancel.Draw(imgSelf));
}
else
{
m_btnConfirmed.SetVisible(false);
m_btnCancel.SetVisible(false);
}
//draw lines
if (m_iCurAction == PdfTrimAction)
{
//Trim
grf.DrawImage(spImageCursor.Get(), m_iLeftCuttingEdge - w/2, m_iTopCuttingEdge -h/2);
grf.DrawImage(spImageCursor.Get(), m_iRightCuttingEdge - w/2, m_iBottomCuttingEdge - h/2);
DebugPrintf(DLC_ZHY,"rect,left,top,right,bottom:%d,%d,%d,%d",m_iLeftCuttingEdge, m_iTopCuttingEdge, m_iRightCuttingEdge, m_iBottomCuttingEdge);
grf.DrawLine(m_iLeftCuttingEdge, m_iTop, 2, m_iHeight, SOLID_STROKE);
grf.DrawLine(m_iRightCuttingEdge, m_iTop, 2, m_iHeight, SOLID_STROKE);
grf.DrawLine(m_iLeft, m_iTopCuttingEdge, m_iWidth, 2, SOLID_STROKE);
grf.DrawLine(m_iLeft, m_iBottomCuttingEdge, m_iWidth, 2, SOLID_STROKE);
}
else
{
grf.DrawLine(m_iColumnedX, m_iTop, 2, m_iHeight, SOLID_STROKE);
grf.DrawImage(spImageCursor.Get(), m_iColumnedX - w/2, m_iColumnedY - h/2);
if (m_iCurAction==PdfColumnedComicOrderLR || m_iCurAction==PdfColumnedComicOrderRL)
{
//split to 2 pages
}
else
{
//split to 4 pages
grf.DrawLine(m_iLeft, m_iColumnedY, m_iWidth, 2, SOLID_STROKE);
}
}
if (m_btnTips.IsVisible())
m_btnTips.SetVisible(false);
DebugPrintf(DLC_ZHY,"leave %s::%s,%s(%d)",GetClassName(), __FUNCTION__, __FILE__, __LINE__);
return hr;
}