author | mickeyl <mickeyl> | 2003-04-12 15:02:32 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-12 15:02:32 (UTC) |
commit | 2cc909c36a779d1041a3382939f8ad41d84b0fc5 (patch) (side-by-side diff) | |
tree | 42c95673d72f7ecb7a8f4acbb0f517dd75ecc167 /noncore/multimedia/camera/previewwidget.cpp | |
parent | 11861d35730cee70920aa6797ba12263bbcce081 (diff) | |
download | opie-2cc909c36a779d1041a3382939f8ad41d84b0fc5.zip opie-2cc909c36a779d1041a3382939f8ad41d84b0fc5.tar.gz opie-2cc909c36a779d1041a3382939f8ad41d84b0fc5.tar.bz2 |
- make main layout a full preview window and think about configuring capturing parameters later...adding an on-demand-applet to the taskbar would be spiffy
- portrait or landscape mode is now self-configuring thanks to life-rotation :-D
Diffstat (limited to 'noncore/multimedia/camera/previewwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/camera/previewwidget.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/noncore/multimedia/camera/previewwidget.cpp b/noncore/multimedia/camera/previewwidget.cpp index bb84c00..cdeacf6 100644 --- a/noncore/multimedia/camera/previewwidget.cpp +++ b/noncore/multimedia/camera/previewwidget.cpp @@ -13,27 +13,46 @@ ** **********************************************************************/ #include "previewwidget.h" #include "zcameraio.h" +#include <opie2/odebug.h> + PreviewWidget::PreviewWidget( QWidget * parent, const char * name, WFlags f ) :QLabel( parent, name, f ) { - setFixedSize( QSize( 240, 160 ) ); + #ifndef QT_NO_DEBUG + setBackgroundColor( QColor( 255, 0, 0 ) ); + #else setBackgroundMode( NoBackground ); + #endif + startTimer( 150 ); + //startTimer( 2000 ); }; PreviewWidget::~PreviewWidget() { } +void PreviewWidget::resizeEvent( QResizeEvent* e ) +{ + QLabel::resizeEvent( e ); + int w = e->size().width(); + int h = e->size().height(); + ZCameraIO::instance()->setCaptureFrame( e->size().width(), + e->size().height(), + 256, + w < h ); +} + + void PreviewWidget::timerEvent( QTimerEvent* ) { //QDirectPainter fb( this ); //ZCameraIO::instance()->snapshot( fb.frameBuffer() ); if ( ZCameraIO::instance()->snapshot( &i ) ) |