本文整理汇总了C++中wxBitmap::GetHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ wxBitmap::GetHandle方法的具体用法?C++ wxBitmap::GetHandle怎么用?C++ wxBitmap::GetHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxBitmap
的用法示例。
在下文中一共展示了wxBitmap::GetHandle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QtSetBitmap
void wxAnyButton::QtSetBitmap( const wxBitmap &bitmap )
{
// load the bitmap and resize the button:
QPixmap *pixmap = bitmap.GetHandle();
m_qtPushButton->setIcon( QIcon( *pixmap ));
m_qtPushButton->setIconSize( pixmap->rect().size() );
}
示例2: DoDrawBitmap
void wxQtDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask )
{
QPixmap pix = *bmp.GetHandle();
if (pix.depth() == 1) {
//Monochrome bitmap, draw using text fore/background
//Save pen/brush
QBrush savedBrush = m_qtPainter->background();
QPen savedPen = m_qtPainter->pen();
//Use text colors
m_qtPainter->setBackground(QBrush(m_textBackgroundColour.GetQColor()));
m_qtPainter->setPen(QPen(m_textForegroundColour.GetQColor()));
//Draw
m_qtPainter->drawPixmap(x, y, pix);
//Restore saved settings
m_qtPainter->setBackground(savedBrush);
m_qtPainter->setPen(savedPen);
}
else
{
if ( useMask && bmp.GetMask() && bmp.GetMask()->GetHandle() )
pix.setMask(*bmp.GetMask()->GetHandle());
m_qtPainter->drawPixmap(x, y, pix);
}
}
示例3: SetItem
bool wxListCtrl::SetItem(wxListItem& info)
{
const long id = info.GetId();
if ( id < 0 )
return false;
QTreeWidgetItem *qitem = QtGetItem(id);
if ( qitem != NULL )
{
if ((info.m_mask & wxLIST_MASK_TEXT) && !info.GetText().IsNull() )
qitem->setText(info.GetColumn(), wxQtConvertString(info.GetText()));
qitem->setTextAlignment(info.GetColumn(), wxQtConvertTextAlign(info.GetAlign()));
if ( info.m_mask & wxLIST_MASK_DATA )
{
QVariant variant = qVariantFromValue(info.GetData());
qitem->setData(0, Qt::UserRole, variant);
}
if (info.m_mask & wxLIST_MASK_STATE)
{
if ((info.m_stateMask & wxLIST_STATE_FOCUSED) &&
(info.m_state & wxLIST_STATE_FOCUSED))
m_qtTreeWidget->setCurrentItem(qitem, 0);
if (info.m_stateMask & wxLIST_STATE_SELECTED)
qitem->setSelected(info.m_state & wxLIST_STATE_SELECTED);
}
if (info.m_mask & wxLIST_MASK_IMAGE)
{
if (info.m_image >= 0)
{
wxImageList *imglst = GetImageList(InReportView() ? wxIMAGE_LIST_SMALL : wxIMAGE_LIST_NORMAL);
wxCHECK_MSG(imglst, false, "invalid listctrl imagelist");
const wxBitmap bitmap = imglst->GetBitmap(info.m_image);
// set the new image:
qitem->setIcon( info.GetColumn(), QIcon( *bitmap.GetHandle() ));
}
else
{
// remove the image using and empty qt icon:
qitem->setIcon( info.GetColumn(), QIcon() );
}
}
for (int col=0; col<GetColumnCount(); col++)
{
if ( info.GetFont().IsOk() )
qitem->setFont(col, info.GetFont().GetHandle() );
if ( info.GetTextColour().IsOk() )
qitem->setTextColor(col, info.GetTextColour().GetQColor());
if ( info.GetBackgroundColour().IsOk() )
qitem->setBackgroundColor(col, info.GetBackgroundColour().GetQColor());
}
return true;
}
else
return false;
}
示例4: Create
bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
{
if (!bitmap.IsOk())
return false;
if (m_qtBitmap)
delete m_qtBitmap;
m_qtBitmap = new QBitmap(bitmap.GetHandle()->createMaskFromColor(colour.GetHandle()));
return true;
}