本文整理汇总了C++中BitmapImage::UnlockBitmap方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapImage::UnlockBitmap方法的具体用法?C++ BitmapImage::UnlockBitmap怎么用?C++ BitmapImage::UnlockBitmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapImage
的用法示例。
在下文中一共展示了BitmapImage::UnlockBitmap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Paint
void Icon::Paint( const Rect &cUpdateRect )
{
EraseRect( cUpdateRect );
if( m_bSelected )
{
Rect cUpdateFrame = GetBounds();
cUpdateFrame.top += 2;
cUpdateFrame.left += 2;
/* XXXKV: This is a hack; why is the height from GetBounds() so large? */
cUpdateFrame.right = m_cSize.x - 2;
cUpdateFrame.bottom = m_cSize.y - 2;
FillRect( cUpdateFrame, m_sHighlightColor );
/* Round edges */
SetDrawingMode( DM_COPY );
SetFgColor( m_sHighlightColor );
DrawLine( os::Point( cUpdateFrame.left + 2, cUpdateFrame.top - 2 ),
os::Point( cUpdateFrame.right - 2, cUpdateFrame.top - 2 ) );
DrawLine( os::Point( cUpdateFrame.left, cUpdateFrame.top - 1 ),
os::Point( cUpdateFrame.right, cUpdateFrame.top - 1 ) );
DrawLine( os::Point( cUpdateFrame.left - 2, cUpdateFrame.top + 2 ),
os::Point( cUpdateFrame.left - 2, cUpdateFrame.bottom - 2 ) );
DrawLine( os::Point( cUpdateFrame.left - 1, cUpdateFrame.top ),
os::Point( cUpdateFrame.left - 1, cUpdateFrame.bottom ) );
DrawLine( os::Point( cUpdateFrame.left + 2, cUpdateFrame.bottom + 2 ),
os::Point( cUpdateFrame.right - 2, cUpdateFrame.bottom + 2 ) );
DrawLine( os::Point( cUpdateFrame.left, cUpdateFrame.bottom + 1 ),
os::Point( cUpdateFrame.right, cUpdateFrame.bottom + 1 ) );
DrawLine( os::Point( cUpdateFrame.right + 2, cUpdateFrame.top + 2 ),
os::Point( cUpdateFrame.right + 2, cUpdateFrame.bottom - 2 ) );
DrawLine( os::Point( cUpdateFrame.right + 1, cUpdateFrame.top ),
os::Point( cUpdateFrame.right + 1, cUpdateFrame.bottom ) );
SetFgColor( m_sFgColor );
}
SetDrawingMode( DM_BLEND );
/* XXXKV: Will only work with BitmapImage; should use RTTI to find
type and handle accordingly */
BitmapImage *pcImage = static_cast<BitmapImage*>( m_pcImage );
Bitmap *pcBitmap = pcImage->LockBitmap();
DrawBitmap( pcBitmap, pcImage->GetBounds(), m_cImageFrame );
pcImage->UnlockBitmap();
/* Draw the icon name */
SetDrawingMode( DM_OVER );
MovePenTo( m_cNamePos );
DrawString( m_cName );
}
示例2: MouseMove
void DockCamera::MouseMove( const os::Point& cNewPos, int nCode, uint32 nButtons, os::Message* pcData )
{
if (nCode == MOUSE_INSIDE)
{
if (m_bHover)
{
Bitmap* pcBitmap = m_pcIcon->LockBitmap();
m_bHover = false;
if( pcPaint == NULL )
{
pcPaint = new BitmapImage(pcBitmap->LockRaster(),IPoint((int)m_pcIcon->GetSize().x,(int)m_pcIcon->GetSize().y),pcBitmap->GetColorSpace());;
pcPaint->ApplyFilter(BitmapImage::F_HIGHLIGHT);
pcBitmap->UnlockRaster();
pcPaint->UnlockBitmap();
}
Invalidate(GetBounds());
Flush();
}
}
else
{
m_bHover = true;
Invalidate(GetBounds());
Flush();
}
if( nCode != MOUSE_ENTERED && nCode != MOUSE_EXITED )
{
/* Create dragging operation */
if( m_bCanDrag )
{
BitmapImage* pcIcon = m_pcIcon;
m_bDragging = true;
os::Message* pcMsg = new os::Message();
BeginDrag( pcMsg, os::Point( pcIcon->GetBounds().Width() / 2,
pcIcon->GetBounds().Height() / 2 ),pcIcon->LockBitmap() );
delete( pcMsg );
m_bCanDrag = false;
Paint(GetBounds());
}
}
os::View::MouseMove( cNewPos, nCode, nButtons, pcData );
}