summaryrefslogtreecommitdiff
path: root/noncore/multimedia/camera/previewwidget.cpp
authormickeyl <mickeyl>2003-04-12 15:02:32 (UTC)
committer mickeyl <mickeyl>2003-04-12 15:02:32 (UTC)
commit2cc909c36a779d1041a3382939f8ad41d84b0fc5 (patch) (unidiff)
tree42c95673d72f7ecb7a8f4acbb0f517dd75ecc167 /noncore/multimedia/camera/previewwidget.cpp
parent11861d35730cee70920aa6797ba12263bbcce081 (diff)
downloadopie-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.cpp21
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
@@ -7,39 +7,58 @@
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "previewwidget.h" 16#include "previewwidget.h"
17#include "zcameraio.h" 17#include "zcameraio.h"
18 18
19#include <opie2/odebug.h>
20
19PreviewWidget::PreviewWidget( QWidget * parent, const char * name, WFlags f ) 21PreviewWidget::PreviewWidget( QWidget * parent, const char * name, WFlags f )
20 :QLabel( parent, name, f ) 22 :QLabel( parent, name, f )
21{ 23{
22 setFixedSize( QSize( 240, 160 ) ); 24 #ifndef QT_NO_DEBUG
25 setBackgroundColor( QColor( 255, 0, 0 ) );
26 #else
23 setBackgroundMode( NoBackground ); 27 setBackgroundMode( NoBackground );
28 #endif
29
24 30
25 startTimer( 150 ); 31 startTimer( 150 );
32 //startTimer( 2000 );
26}; 33};
27 34
28 35
29PreviewWidget::~PreviewWidget() 36PreviewWidget::~PreviewWidget()
30{ 37{
31} 38}
32 39
33 40
41void PreviewWidget::resizeEvent( QResizeEvent* e )
42{
43 QLabel::resizeEvent( e );
44 int w = e->size().width();
45 int h = e->size().height();
46 ZCameraIO::instance()->setCaptureFrame( e->size().width(),
47 e->size().height(),
48 256,
49 w < h );
50}
51
52
34void PreviewWidget::timerEvent( QTimerEvent* ) 53void PreviewWidget::timerEvent( QTimerEvent* )
35{ 54{
36 //QDirectPainter fb( this ); 55 //QDirectPainter fb( this );
37 //ZCameraIO::instance()->snapshot( fb.frameBuffer() ); 56 //ZCameraIO::instance()->snapshot( fb.frameBuffer() );
38 57
39 if ( ZCameraIO::instance()->snapshot( &i ) ) 58 if ( ZCameraIO::instance()->snapshot( &i ) )
40 { 59 {
41 p.convertFromImage( i ); 60 p.convertFromImage( i );
42 setPixmap( p ); 61 setPixmap( p );
43 } 62 }
44} 63}
45 64