1 Attachment(s)
Moving left and right on the screen
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
Re: Moving left and right on the screen
How about using QScrollArea with a QLabel holding the image?
Re: Moving left and right on the screen
Quote:
Originally Posted by
wysota
I am not quite sure how to do that.
Re: Moving left and right on the screen
Quote:
Originally Posted by
Benjamin
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...
Re: Moving left and right on the screen
Quote:
Originally Posted by
Lykurg
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.
Re: Moving left and right on the screen
Quote:
Originally Posted by
Benjamin
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...
Re: Moving left and right on the screen
Quote:
Originally Posted by
Lykurg
Ah, that makes sense. I have not seen that. I will give it a try.
Thank you!!!