我正在使用C#开发适用于Windows Phone 8的应用程序
我一直在努力工作MessageBox.Show(),并且它一直用于显示我想要的PopUp消息,但突然间,它不会显示任何内容,我调试应用程序,代码正常运行并编译线MessageBox.Show("Something");
但它没弹出来!
我也试着把它放在另一页,也不行!我记得昨天我搞砸了项目的参考资料 但这是问题吗?
无论如何这里是我的项目参考的照片

我希望每次,用户调整Form的大小,PictureBox中的Image,也使用相同的值(按比例)调整大小,
我在互联网上搜索了一些代码,并在StackOverFlow中 找到了这个答案/sf/answers/455139821/
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, ratioY);
var newWidth = (int)(image.Width * ratio);
var newHeight = (int)(image.Height * ratio);
var newImage = new Bitmap(newWidth, newHeight);
Graphics.FromImage(newImage).DrawImage(image, 0, 0, newWidth, newHeight);
Bitmap bmp = new Bitmap(newImage);
return bmp;
}
Run Code Online (Sandbox Code Playgroud)
我为我的代码添加了函数,我不确定MaxHeight,MaxWidth的事情,我的意思是为什么我需要通过参数发送它
在Form1_Resize我写的事件处理程序中:
private void Form1_Resize(object sender, EventArgs e)
{
Bitmap NewImg = ScaleImage(pictureBox1.Image, 1000, 1000); …Run Code Online (Sandbox Code Playgroud) 我正在寻找一种算法,找到给定年份数的dd/mm格式(1 - 365)
示例:
1 - > 01/01
364 - > 30/12