本文整理汇总了C++中BitmapImage::transform方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapImage::transform方法的具体用法?C++ BitmapImage::transform怎么用?C++ BitmapImage::transform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapImage
的用法示例。
在下文中一共展示了BitmapImage::transform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paste
void Editor::paste()
{
if((cutFlag||copyFlag)&&layers()->currentLayerIndex()>2)
{
newBitmapLayer();
}
Layer* layer = mObject->getLayer( layers()->currentLayerIndex() );
if ( layer != NULL )
{
if ( layer->type() == Layer::BITMAP && g_clipboardBitmapImage.image() != NULL )
{
backup( tr( "Paste" ) );
BitmapImage tobePasted = g_clipboardBitmapImage.copy();
qDebug() << "to be pasted --->" << tobePasted.image()->size();
if ( mScribbleArea->somethingSelected )
{
QRectF selection = mScribbleArea->getSelection();
if ( g_clipboardBitmapImage.width() <= selection.width() && g_clipboardBitmapImage.height() <= selection.height() )
{
tobePasted.moveTopLeft( selection.topLeft() );
}
else
{
tobePasted.transform( selection, true );
}
}
auto pLayerBitmap = static_cast< LayerBitmap* >( layer );
pLayerBitmap->getLastBitmapImageAtFrame( currentFrame(), 0 )->paste( &tobePasted ); // paste the clipboard
}
else if ( layer->type() == Layer::VECTOR && clipboardVectorOk )
{
backup( tr( "Paste" ) );
mScribbleArea->deselectAll();
VectorImage* vectorImage = ( ( LayerVector* )layer )->getLastVectorImageAtFrame( currentFrame(), 0 );
vectorImage->paste( g_clipboardVectorImage ); // paste the clipboard
mScribbleArea->setSelection( vectorImage->getSelectionRect(), true );
//((LayerVector*)layer)->getLastVectorImageAtFrame(backupFrame, 0)->modification(); ????
}
}
mScribbleArea->updateCurrentFrame();
if((cutFlag&&!mScribbleArea->somethingSelected)||(copyFlag&&mScribbleArea->somethingSelected))
{
mScribbleArea->mySelection=cutArea;
mScribbleArea->setSelection( mScribbleArea->mySelection, true );
mScribbleArea->myTransformedSelection = mScribbleArea->mySelection.adjusted( 0, 0, 0, 0 );
mScribbleArea->myTempTransformedSelection = mScribbleArea->mySelection.adjusted( 0, 0, 0, 0 );
mScribbleArea->update();
mScribbleArea->mIncludeImg[mLayerManager->currentLayerIndex()]=mScribbleArea->mySelection;
tools()->setCurrentTool(MOVE);
}
cutFlag =0;
copyFlag =0;
}
示例2: paste
void Editor::paste()
{
Layer* layer = mObject->getLayer( layers()->currentLayerIndex() );
if ( layer != NULL )
{
if ( layer->type() == Layer::BITMAP && g_clipboardBitmapImage.image() != NULL )
{
backup( tr( "Paste" ) );
BitmapImage tobePasted = g_clipboardBitmapImage.copy();
qDebug() << "to be pasted --->" << tobePasted.image()->size();
if ( mScribbleArea->somethingSelected )
{
QRectF selection = mScribbleArea->getSelection();
if ( g_clipboardBitmapImage.width() <= selection.width() && g_clipboardBitmapImage.height() <= selection.height() )
{
tobePasted.moveTopLeft( selection.topLeft() );
}
else
{
tobePasted.transform( selection, true );
}
}
auto pLayerBitmap = static_cast< LayerBitmap* >( layer );
pLayerBitmap->getLastBitmapImageAtFrame( currentFrame(), 0 )->paste( &tobePasted ); // paste the clipboard
}
else if ( layer->type() == Layer::VECTOR && clipboardVectorOk )
{
backup( tr( "Paste" ) );
mScribbleArea->deselectAll();
VectorImage* vectorImage = ( ( LayerVector* )layer )->getLastVectorImageAtFrame( currentFrame(), 0 );
vectorImage->paste( g_clipboardVectorImage ); // paste the clipboard
mScribbleArea->setSelection( vectorImage->getSelectionRect(), true );
//((LayerVector*)layer)->getLastVectorImageAtFrame(backupFrame, 0)->modification(); ????
}
}
mScribbleArea->updateCurrentFrame();
}