AlphaPictureBox bar_img;
bar_img = new AlphaPictureBox();
bar_img.Image = AlphaImage.CreateFromFile(path + @"/image/sb_thumber.png");
bar_img.Location = new Point(location.X, location.Y + 40);
bar_img.Size = new Size(40, 40);
bar_img.SizeMode = PictureBoxSizeMode.StretchImage;
bar_img.Draw(grap);
以上标红部分会报参数错误异常,即便换成如下也无法通过。
bar_img.SizeMode = (PictureBoxSizeMode)Enum.Parse(typeof(PictureBoxSizeMode), "1", true);
换成Normal,CenterImage就可以,这是AlphaMobileControls 控件的bug。
以下是可以缩放的方法: