本文整理汇总了C++中SPtr::GetWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ SPtr::GetWidth方法的具体用法?C++ SPtr::GetWidth怎么用?C++ SPtr::GetWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPtr
的用法示例。
在下文中一共展示了SPtr::GetWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: InitItem
HRESULT UIWifiListItem::InitItem()
{
m_strSSID.clear();
m_iQualityLv = 0;
m_fIsProtected = FALSE;
m_fIsConn = FALSE;
m_strStateMess.clear();
SetLongClickable(true);
DebugLog(DLC_GUI, "UIWifiListItem::InitItem===========\n");
SPtr<ITpImage> pimgSelectedAP = ImageManager::GetImage(IMAGE_TOUCH_ICON_SELECT);
if (NULL == m_pSSIDLabel)
{
m_pSSIDLabel = new UITextSingleLine(this, IDSTATIC);
if(NULL == m_pSSIDLabel)
{
return E_OUTOFMEMORY;
}
m_pSSIDLabel->SetFontSize(GetWindowFontSize(UIWifiDialogListSSIDIndex));
}
if (NULL == m_pProtecedAPImg)
{
m_pProtecedAPImg = new UIImage(this, IDSTATIC);
if(NULL == m_pProtecedAPImg)
{
return E_OUTOFMEMORY;
}
SPtr<ITpImage> pimgProtectedAP = ImageManager::GetImage(IMAGE_PROCTED_AP);
m_pProtecedAPImg->SetImage(pimgProtectedAP);
}
if (NULL == m_pSelectedAPImg)
{
m_pSelectedAPImg = new UIImage(this, IDSTATIC);
if(NULL == m_pSelectedAPImg)
{
return E_OUTOFMEMORY;
}
m_pSelectedAPImg->SetMinSize(dkSize(pimgSelectedAP->GetWidth(), pimgSelectedAP->GetHeight()));
}
if (!m_windowSizer)
{
UISizer* mainSizer = new UIBoxSizer(dkVERTICAL);
SPtr<ITpImage> pimgSignalAP = ImageManager::GetImage(IMAGE_TOUCH_ICON_WIFI_LEVEL);
if (mainSizer)
{
mainSizer->AddStretchSpacer();
UISizer* ssidSizer = new UIBoxSizer(dkHORIZONTAL);
if (ssidSizer)
{
ssidSizer->Add(m_pSelectedAPImg, UISizerFlags().Border(dkRIGHT, GetWindowMetrics(UIWifiListItemStatusImgRightMarginIndex)).Align(dkALIGN_CENTER_VERTICAL).ReserveSpaceEvenIfHidden());
ssidSizer->Add(m_pSSIDLabel, UISizerFlags(1).Align(dkALIGN_CENTER_VERTICAL));
ssidSizer->Add(m_pProtecedAPImg, UISizerFlags().Align(dkALIGN_CENTER_VERTICAL).Border(dkRIGHT, 14+pimgSignalAP->GetWidth()));
mainSizer->Add(ssidSizer, UISizerFlags().Expand());
}
mainSizer->AddSpacer(GetWindowMetrics(UIWifiListItemSSIDBottomMarginIndex));
SetSizer(mainSizer);
}
}
DebugLog(DLC_GUI, "UIWifiListItem::InitItem exit ========\n");
return S_OK;
}
示例3: 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;
}