示例#1
0
BitmapImage BitmapImage::copy(QRect rectangle)
{
    if (rectangle.isEmpty() || mBounds.isEmpty()) return BitmapImage();

    QRect intersection2 = rectangle.translated(-mBounds.topLeft());
    BitmapImage result = BitmapImage(rectangle.topLeft(), image()->copy(intersection2));
    return result;
}
示例#2
0
BitmapImage BitmapImage::copy(QRect rectangle)
{
    //QRect intersection = boundaries.intersected( rectangle );
    QRect intersection2  = rectangle.translated( -topLeft() );
    BitmapImage result = BitmapImage(rectangle, mImage->copy(intersection2));
    return result;
}
示例#3
0
BitmapImage BitmapImage::transformed(QRect selection, QTransform transform, bool smoothTransform)
{
    Q_ASSERT(!selection.isEmpty());

    BitmapImage selectedPart = copy(selection);

    // Get the transformed image
    QImage transformedImage;
    if (smoothTransform)
    {
        transformedImage = selectedPart.image()->transformed(transform, Qt::SmoothTransformation);
    }
    else
    {
        transformedImage = selectedPart.image()->transformed(transform);
    }
    return BitmapImage(transform.mapRect(selection).normalized().topLeft(), transformedImage);
}
示例#4
0
BitmapImage BitmapImage::copy()
{
    return BitmapImage(mBounds, QImage(*mImage));
}
示例#5
0
BitmapImage BitmapImage::copy()
{
    return BitmapImage(myParent, boundaries, QImage(*image));
}
示例#6
0
BitmapImage BitmapImage::copy()
{
    return BitmapImage(mBounds.topLeft(), *image());
}