1 /***************************************************************************
2     copyright            : (C) 2006 by mean
3     email                : fixounet@free.fr
4 ***************************************************************************/
5 
6 /***************************************************************************
7 *                                                                         *
8 *   This program is free software; you can redistribute it and/or modify  *
9 *   it under the terms of the GNU General Public License as published by  *
10 *   the Free Software Foundation; either version 2 of the License, or     *
11 *   (at your option) any later version.                                   *
12 *                                                                         *
13 ***************************************************************************///
14 
15 #include <QPainter>
16 #include <QGraphicsView>
17 #include <QSlider>
18 
19 #include "ADM_default.h"
20 #include "DIA_flyDialogQt4.h"
21 
changeSize(uint32_t w,uint32_t h)22 void ADM_QCanvas::changeSize(uint32_t w,uint32_t h)
23 {
24 	_w=w;
25 	_h=h;
26 	dataBuffer=NULL;
27 	resize(w,h);
28 }
29 
ADM_QCanvas(QWidget * z,uint32_t w,uint32_t h)30 ADM_QCanvas::ADM_QCanvas(QWidget *z,uint32_t w,uint32_t h) : QWidget(z)
31 {
32 	_w=w;
33 	_h=h;
34 	dataBuffer=NULL;
35 	resize(w,h);
36 }
37 
~ADM_QCanvas()38 ADM_QCanvas::~ADM_QCanvas()
39 {
40 }
41 
42 /**
43     \fn paintEvent( QPaintEvent *ev))
44     \brief Repaint our "video" widget, ignore when accelRender is on
45 */
paintEvent(QPaintEvent * ev)46 void ADM_QCanvas::paintEvent(QPaintEvent *ev)
47 {
48 	if(!dataBuffer)
49 		return ;
50 
51 	QImage image(dataBuffer,_w,_h,QImage::Format_RGB32);
52 	QPainter painter(this);
53 	painter.drawImage(QPoint(0,0),image);
54 	painter.end();
55 }
56 //EOF
57