Page 1 of 1

viewport

Posted: Wed Jul 28, 2010 2:49 am
by Steve
I am trying to create what, in other languages, is often called a viewport. That is, I have a large image, but I want to show only a small rectangular part of it. I don't want to create a huge mask to cover the rest of the image, as that blocks out lots of other objects on the card. I want to be able to (somehow) define just the small rectangle that lets that part of the larger object show through.

I had assumed this can be done with some choice of Blends and transparency, but I have tried many combinations and cannot create a viewport effect. I can always block what's under the small rectangle, but I cannot "allow through" what's under the small rectangle.

Any suggestions?

Re: viewport

Posted: Wed Jul 28, 2010 3:15 am
by FourthWorld
Put the image object in a group control.

Re: viewport

Posted: Thu Jul 29, 2010 4:05 am
by Steve
Thanks, Richard! That worked. I learned that I also need to "lock" the location of the group, or it changes along with changes to the images location.

Steve

Re: viewport

Posted: Thu Jul 29, 2010 3:39 pm
by FourthWorld
Glad that was helpful. Yes, locking the interior objects can help in a good many uses of groups.

You may also want to explore the boundingRect property for groups. You won't need it all the time, but if you want to have multiple objects in a group which has a scrolling area larger than their collective bounds, the boundingRect will let you define the effective area of the group so you can do some nice canvas-like things with them.