Beispiel #1
0
void ImageDisplay::mouseReleaseEvent ( QMouseEvent* event ) {
  QGLWidget::mouseReleaseEvent ( event );
  makeDrop ( event->x(), event->y() );
  float left = dragX * ( image->width() / ( float ) width() );
  float right = dropX * ( image->width() / ( float ) width() );
  float top = dragY * ( image->height() / ( float ) height() );
  float bottom = dropY * ( image->height() / ( float ) height() );

  if ( left > right ) {
    std::swap ( left, right );
  }
  if ( top > bottom ) {
    std::swap ( top, bottom );
  }

  emit rectSelect ( left, top, right, bottom );
}
Beispiel #2
0
void takeArea() {
    takeScreenshot(rectSelect());
}