author | mickeyl <mickeyl> | 2003-04-12 15:02:32 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-12 15:02:32 (UTC) |
commit | 2cc909c36a779d1041a3382939f8ad41d84b0fc5 (patch) (unidiff) | |
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) (show 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 | |||
@@ -16,13 +16,20 @@ | |||
16 | #include "previewwidget.h" | 16 | #include "previewwidget.h" |
17 | #include "zcameraio.h" | 17 | #include "zcameraio.h" |
18 | 18 | ||
19 | #include <opie2/odebug.h> | ||
20 | |||
19 | PreviewWidget::PreviewWidget( QWidget * parent, const char * name, WFlags f ) | 21 | PreviewWidget::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 | ||
@@ -31,6 +38,18 @@ PreviewWidget::~PreviewWidget() | |||
31 | } | 38 | } |
32 | 39 | ||
33 | 40 | ||
41 | void 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 | |||
34 | void PreviewWidget::timerEvent( QTimerEvent* ) | 53 | void PreviewWidget::timerEvent( QTimerEvent* ) |
35 | { | 54 | { |
36 | //QDirectPainter fb( this ); | 55 | //QDirectPainter fb( this ); |