我有一个问题的大小在统一的UI面板上的按钮点击。我在左边输入了一个负值,但在我运行它之后,它没有读取"-“值,我还想将面板的大小缩放到1.24。这是我执行代码后的默认状态的图片,以及我希望它是什么样子。我很抱歉,因为我很难用语言来解释它,所以我只用一张图片来编译它。
PS。我已经搜索了可以调整矩形大小的代码,但是矩形就这么消失了。
//Scaling left and right of the panel
DescriptionPanel.GetComponent<RectTransform>().offsetMax = new Vector2(-91
我正在制作一个应用程序,在这个应用程序中,我加载了一组256 x 256 box块的地图,并将它们与magick.net缝合在一起,然后将它们显示在一个图片框中。我在图片框控件上添加了一个功能,用于使用鼠标事件来旋转图像(并像我一样加载新的图片块),如下所示:
// Set true when mouse should slew the picture in the picture box
private bool isSlewing = false;
// last position of the mouse in map space when slewing
private float l
我希望每次用户调整表单的大小,pictureBox中的图像,也用相同的值调整大小(按比例计算),
我在网上搜索了一些密码,并在StackOverFlow 中找到了这个答案。
static public Bitmap ScaleImage(Image image, int maxWidth, int maxHeight)
{
var ratioX = (double)maxWidth / image.Width;
var ratioY = (double)maxHeight / image.Height;
var ratio = Math.Min(ratioX, rati