PDA

View Full Version : Moving left and right on the screen



Benjamin
21st June 2009, 18:30
Hi all,

I have a pixmap that is 1000 pixels wide and the screen that is 220 pixels wide. What I am trying to do is to write some stuff on this 1000 pixels wide pixmap and move left and right to see that data. So I would initially write all data on this 1000 pixels wide pixmap but I don't exactly know how to implement this left/right scrolling over this pixmap. Does anyone has any idea? I have attached a picture with a description.


Thank youm
Benjamin

wysota
21st June 2009, 18:42
How about using QScrollArea with a QLabel holding the image?

Benjamin
21st June 2009, 19:17
How about using QScrollArea with a QLabel holding the image?

I am not quite sure how to do that.

Lykurg
21st June 2009, 19:27
I am not quite sure how to do that.

Have you had a look at the packages? Don't think so, because in the Detailed Description of QScrollArea there is exactly an example, which you need...

Benjamin
21st June 2009, 19:48
Have you had a look at the packages? Don't think so, because in the Detailed Description of QScrollArea there is exactly an example, which you need...

As I can see QScroollArea uses a QLabel that has an image loaded in it. But in my case I have a file with some graphic data. I need to write these data on a pixmap and than scroll over that pixmap as I have presented on attached picture.

Lykurg
21st June 2009, 20:01
As I can see QScroollArea uses a QLabel that has an image loaded in it. But in my case I have a file with some graphic data. I need to write these data on a pixmap and than scroll over that pixmap as I have presented on attached picture.

Yeah, and a QLabel is not a picture, but you can set a picture/image what ever (=QPixmap) on it, so how they do at the example. QPixmap in the QLabel. QLabel in the QScrollArea.


And beside in the example they transform the QImage in a QPixmap before setting it at the QLabel...

Benjamin
21st June 2009, 20:09
Yeah, and a QLabel is not a picture, but you can set a picture/image what ever (=QPixmap) on it, so how they do at the example. QPixmap in the QLabel. QLabel in the QScrollArea.


And beside in the example they transform the QImage in a QPixmap before setting it at the QLabel...

Ah, that makes sense. I have not seen that. I will give it a try.

Thank you!!!