[英]VB.NET: PictureBox view range?
I two pictureboxes in my application: One that is mostly just a background image, and another which you can move around changing some settings. 我在应用程序中有两个图片框:一个主要是背景图片,另一个可以更改某些设置。
However, depending on my settings (X,Y,Width,Height), a fragment or all of the second picturebox might be "out" of the first picturebox. 但是,根据我的设置(X,Y,Width,Height),第二个图片框的一部分或全部可能在第一个图片框的“外面”。 I don't want that. 我不要
Basically, if there is anything in the second picturebox's that is not over the first picturebox, I don't want to show that fragment. 基本上,如果第二个图片框中没有位于第一个图片框上方的任何内容,则我不想显示该片段。 I want to cut it. 我要剪
If I move the second picturebox back inside the first picturebox, then I can see all of it again. 如果将第二个图片框移回第一个图片框内,则可以再次看到所有图片框。
Think of the first picturebox as a "view range" 将第一个图片框视为“查看范围”
Fixed: 固定:
I set the second picturebox's parent to the first picturebox. 我将第二个图片框的父对象设置为第一个图片框。 Now the second picturebox is cut if it leaves the first picturebox's area. 现在,如果第二个图片框离开第一个图片框的区域,则将其剪切。
Sorry for wasting your time :( 抱歉浪费您的时间:(
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.