本文整理汇总了C++中BitmapImage::setImage方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapImage::setImage方法的具体用法?C++ BitmapImage::setImage怎么用?C++ BitmapImage::setImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapImage
的用法示例。
在下文中一共展示了BitmapImage::setImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clipboardChanged
void Editor::clipboardChanged()
{
if ( clipboardBitmapOk == false )
{
g_clipboardBitmapImage.setImage( new QImage( QApplication::clipboard()->image() ) );
g_clipboardBitmapImage.bounds() = QRect( g_clipboardBitmapImage.topLeft(), g_clipboardBitmapImage.image()->size() );
qDebug() << "New clipboard image" << g_clipboardBitmapImage.image()->size();
}
else
{
clipboardBitmapOk = false;
qDebug() << "The image has been saved in the clipboard";
}
}
示例2: paintVectorFrame
void CanvasRenderer::paintVectorFrame( QPainter& painter,
int layerId,
int nFrame,
bool colorize,
bool useLastKeyFrame )
{
Layer* layer = mObject->getLayer( layerId );
if ( !layer->visible() )
{
return;
}
LayerVector* vectorLayer = dynamic_cast< LayerVector* >( layer );
if ( vectorLayer == nullptr )
{
Q_ASSERT( vectorLayer );
return;
}
qCDebug( mLog ) << "Paint Onion skin vector, Frame = " << nFrame;
VectorImage* vectorImage;
if (useLastKeyFrame)
{
vectorImage = vectorLayer->getLastVectorImageAtFrame( nFrame, 0 );
}
else
{
vectorImage = vectorLayer->getVectorImageAtFrame( nFrame );
}
if ( vectorImage == nullptr )
{
return;
}
QImage* pImage = new QImage( mCanvas->size(), QImage::Format_ARGB32_Premultiplied );
vectorImage->outputImage( pImage, mViewTransform, mOptions.bOutlines, mOptions.bThinLines, mOptions.bAntiAlias );
//painter.drawImage( QPoint( 0, 0 ), *pImage );
// Go through a Bitmap image to paint the onion skin colour
//
BitmapImage* tempBitmapImage = new BitmapImage();
tempBitmapImage->setImage(pImage);
if ( colorize )
{
QBrush colorBrush = QBrush(Qt::transparent); //no color for the current frame
if (nFrame < mFrameNumber)
{
colorBrush = QBrush(Qt::red);
}
else if (nFrame > mFrameNumber)
{
colorBrush = QBrush(Qt::blue);
}
tempBitmapImage->drawRect( pImage->rect(),
Qt::NoPen,
colorBrush,
QPainter::CompositionMode_SourceIn,
false);
}
painter.setWorldMatrixEnabled( false ); //Don't tranform the image here as we used the viewTransform in the image output
tempBitmapImage->paintImage( painter );
delete tempBitmapImage;
}