Drawing outside the container
-
Ok, I have a question: Say I have a panel, and in that panel I have a couple of images, arranged in a row, side by side. Using a timer, I want to 'grow' one of the images and also allow it to grow outside of the panel control without getting clipped. Is this possible? If so, how would I go about doing this?
-
Ok, I have a question: Say I have a panel, and in that panel I have a couple of images, arranged in a row, side by side. Using a timer, I want to 'grow' one of the images and also allow it to grow outside of the panel control without getting clipped. Is this possible? If so, how would I go about doing this?
-
seanwright wrote:
Using a timer, I want to 'grow' one of the images and also allow it to grow outside of the panel control without getting clipped. Is this possible?
Yes, use scrolled window.
Best, Jun
Could you be more specific?
-
Ok, I have a question: Say I have a panel, and in that panel I have a couple of images, arranged in a row, side by side. Using a timer, I want to 'grow' one of the images and also allow it to grow outside of the panel control without getting clipped. Is this possible? If so, how would I go about doing this?
A control normally won't draw outside it's specified area. Of course you can draw outside the control, but there is no way that you can keep what you have drawn up to date. The control will not get any notification that what you have drawn has been erased and needs redrawing. Create a new control that has the size to contain what you want to draw, place it on top of your control, and use the new control to do the drawing.
--- b { font-weight: normal; }
-
Could you be more specific?
I don't think you actually draw outside the control. What you could do is: 1) Use a scrolled window as your container control. When the image grows larger than the window, use the scroll bar to view the hidden portion. Or 2) Support panning capability. Basically, when the image is larger than the window, press the left key and drag the image so that the control window shows the portion that you want to see. In implementation, you draw the entire image to a graphic buffer and only render a portion of it (the same size as the constrol) to the control window. Hope this helps.
Best, Jun