.TH "KPixmapRegionSelectorWidget" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KPixmapRegionSelectorWidget \- KPixmapRegionSelectorWidget is a widget that shows a picture and provides the user with a friendly way to select a rectangular subregion of the pixmap.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kpixmapregionselectorwidget.h>\fP
.PP
Inherits \fBQWidget\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBrotateClockwise\fP ()"
.br
.ti -1c
.RI "void \fBrotateCounterclockwise\fP ()"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKPixmapRegionSelectorWidget\fP (\fBQWidget\fP *parent=0L, const char *name=0L)"
.br
.ti -1c
.RI "\fB~KPixmapRegionSelectorWidget\fP ()"
.br
.ti -1c
.RI "void \fBsetPixmap\fP (const \fBQPixmap\fP &pixmap)"
.br
.ti -1c
.RI "\fBQPixmap\fP \fBpixmap\fP () const "
.br
.ti -1c
.RI "void \fBsetSelectedRegion\fP (const \fBQRect\fP &\fBrect\fP)"
.br
.ti -1c
.RI "\fBQRect\fP \fBselectedRegion\fP () const "
.br
.ti -1c
.RI "\fBQRect\fP \fBunzoomedSelectedRegion\fP () const "
.br
.ti -1c
.RI "void \fBresetSelection\fP ()"
.br
.ti -1c
.RI "\fBQImage\fP \fBselectedImage\fP () const "
.br
.ti -1c
.RI "void \fBsetSelectionAspectRatio\fP (int \fBwidth\fP, int \fBheight\fP)"
.br
.ti -1c
.RI "void \fBsetFreeSelectionAspectRatio\fP ()"
.br
.ti -1c
.RI "void \fBsetMaximumWidgetSize\fP (int \fBwidth\fP, int \fBheight\fP)"
.br
.ti -1c
.RI "void \fBrotate\fP (\fBKImageEffect::RotateDirection\fP direction)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual \fBKPopupMenu\fP * \fBcreatePopupMenu\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
KPixmapRegionSelectorWidget is a widget that shows a picture and provides the user with a friendly way to select a rectangular subregion of the pixmap. 

NOTE: There are two copies of this .h and the .cpp file, with subtle differences. One copy is in kdelibs/kdeui, and the other copy is in kdepim/libkdepim This is because kdepim has to remain backwards compatible. Any changes to either file should be made to the other.
.PP
\fBAuthor:\fP
.RS 4
Antonio Larrosa <larrosa@kde.org> 
.RE
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 44 of file kpixmapregionselectorwidget.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KPixmapRegionSelectorWidget::KPixmapRegionSelectorWidget (\fBQWidget\fP * parent = \fC0L\fP, const char * name = \fC0L\fP)"
.PP
Constructor for a KPixmapRegionSelectorWidget. 
.PP
Definition at line 40 of file kpixmapregionselectorwidget.cpp.
.SS "KPixmapRegionSelectorWidget::~\fBKPixmapRegionSelectorWidget\fP ()"
.PP
Destructor for a KPixmapRegionSelectorWidget. 
.PP
Definition at line 63 of file kpixmapregionselectorwidget.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KPixmapRegionSelectorWidget::setPixmap (const \fBQPixmap\fP & pixmap)"
.PP
Sets the pixmap which will be shown for the user to select a region from. 
.PP
\fBParameters:\fP
.RS 4
\fIpixmap\fP The pixmap. Must be non-null. 
.RE
.PP

.PP
Definition at line 67 of file kpixmapregionselectorwidget.cpp.
.PP
References QPixmap::isNull(), pixmap(), resetSelection(), and QLabel::setPixmap().
.PP
Referenced by KPixmapRegionSelectorDialog::getSelectedImage(), and KPixmapRegionSelectorDialog::getSelectedRegion().
.SS "\fBQPixmap\fP KPixmapRegionSelectorWidget::pixmap () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the original whole pixmap that we're using in this widget as the pixmap the user is selecting a region from. 
.RE
.PP

.PP
Definition at line 69 of file kpixmapregionselectorwidget.h.
.PP
Referenced by setPixmap().
.SS "void KPixmapRegionSelectorWidget::setSelectedRegion (const \fBQRect\fP & rect)"
.PP
Sets the selected region to be \fCrect\fP (in zoomed pixmap coordinates). 
.PP
Definition at line 87 of file kpixmapregionselectorwidget.cpp.
.PP
References resetSelection(), and unzoomedSelectedRegion().
.SS "\fBQRect\fP KPixmapRegionSelectorWidget::selectedRegion () const"
.PP
Returns the selected region ( in zoomed pixmap coordinates ). 
.PP
Definition at line 82 of file kpixmapregionselectorwidget.cpp.
.SS "\fBQRect\fP KPixmapRegionSelectorWidget::unzoomedSelectedRegion () const"
.PP
Returns the selected region ( in unzoomed, original pixmap coordinates ). 
.PP
Definition at line 388 of file kpixmapregionselectorwidget.cpp.
.PP
References QRect::height(), QRect::width(), QRect::x(), and QRect::y().
.PP
Referenced by KPixmapRegionSelectorDialog::getSelectedRegion(), selectedImage(), and setSelectedRegion().
.SS "void KPixmapRegionSelectorWidget::resetSelection ()"
.PP
Resets the selection to use the whole image. 
.PP
Definition at line 76 of file kpixmapregionselectorwidget.cpp.
.PP
References QPixmap::rect().
.PP
Referenced by rotate(), setPixmap(), and setSelectedRegion().
.SS "\fBQImage\fP KPixmapRegionSelectorWidget::selectedImage () const"
.PP
\fBReturns:\fP
.RS 4
a \fBQImage\fP object with just the region the user selected from the image 
.RE
.PP

.PP
Definition at line 396 of file kpixmapregionselectorwidget.cpp.
.PP
References QPixmap::convertToImage(), QImage::copy(), and unzoomedSelectedRegion().
.PP
Referenced by KPixmapRegionSelectorDialog::getSelectedImage().
.SS "void KPixmapRegionSelectorWidget::setSelectionAspectRatio (int width, int height)"
.PP
Sets the aspect ration that the selected subimage should have. 
.PP
The way to select it, is specifying an example valid \fCwidth\fP and \fCheight\fP. 
.PP
\fBSee also:\fP
.RS 4
\fBsetFreeSelectionAspectRatio()\fP 
.RE
.PP

.PP
Definition at line 402 of file kpixmapregionselectorwidget.cpp.
.PP
Referenced by KPixmapRegionSelectorDialog::getSelectedImage(), and KPixmapRegionSelectorDialog::getSelectedRegion().
.SS "void KPixmapRegionSelectorWidget::setFreeSelectionAspectRatio ()"
.PP
Allows the user to do a selection which has any aspect ratio. 
.PP
This is the default. 
.PP
\fBSee also:\fP
.RS 4
\fBsetSelectionAspectRatio()\fP 
.RE
.PP

.PP
Definition at line 407 of file kpixmapregionselectorwidget.cpp.
.SS "void KPixmapRegionSelectorWidget::setMaximumWidgetSize (int width, int height)"
.PP
Sets the maximum size for the widget. 
.PP
If the image is larger than this (either horizontally or vertically), it's scaled to adjust to the maximum size (preserving the aspect ratio) 
.PP
Definition at line 412 of file kpixmapregionselectorwidget.cpp.
.PP
References QPixmap::convertFromImage(), QPixmap::convertToImage(), QRect::height(), QPixmap::height(), QPixmap::isNull(), QRect::isValid(), QPixmap::rect(), QWidget::resize(), QImage::smoothScale(), QRect::width(), QPixmap::width(), QRect::x(), and QRect::y().
.PP
Referenced by KPixmapRegionSelectorDialog::getSelectedImage(), and KPixmapRegionSelectorDialog::getSelectedRegion().
.SS "void KPixmapRegionSelectorWidget::rotate (\fBKImageEffect::RotateDirection\fP direction)"
.PP
Rotates the image as specified by the \fCdirection\fP parameter, also tries to rotate the selected region so that it doesn't change, as long as the forced aspect ratio setting is respected, in other case, the selected region is resetted. 
.PP
Definition at line 160 of file kpixmapregionselectorwidget.cpp.
.PP
References QPixmap::convertFromImage(), QPixmap::convertToImage(), QRect::height(), QPixmap::height(), resetSelection(), KImageEffect::rotate(), QRect::setRect(), QRect::width(), QPixmap::width(), QRect::x(), and QRect::y().
.PP
Referenced by rotateClockwise(), and rotateCounterclockwise().
.SS "void KPixmapRegionSelectorWidget::rotateClockwise ()\fC [slot]\fP"
.PP
Rotates the current image 90º clockwise. 
.PP
Definition at line 199 of file kpixmapregionselectorwidget.cpp.
.PP
References rotate().
.PP
Referenced by createPopupMenu().
.SS "void KPixmapRegionSelectorWidget::rotateCounterclockwise ()\fC [slot]\fP"
.PP
Rotates the current image 90º counterclockwise. 
.PP
Definition at line 204 of file kpixmapregionselectorwidget.cpp.
.PP
References rotate().
.PP
Referenced by createPopupMenu().
.SS "\fBKPopupMenu\fP * KPixmapRegionSelectorWidget::createPopupMenu ()\fC [protected, virtual]\fP"
.PP
Creates a \fBKPopupMenu\fP with the menu that appears when clicking with the right button on the label. 
.PP
Definition at line 138 of file kpixmapregionselectorwidget.cpp.
.PP
References KPopupMenu::insertTitle(), rotateClockwise(), and rotateCounterclockwise().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
