Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
显示图像-c#/silverlight_C#_Silverlight_Windows Phone 7 - Fatal编程技术网

显示图像-c#/silverlight

显示图像-c#/silverlight,c#,silverlight,windows-phone-7,C#,Silverlight,Windows Phone 7,专家们 我正在Windows phone中开发一个应用程序,我需要在屏幕上以表格格式显示图像(行和列中的两个图像将根据需要增长)。 图像计数将是动态的,我将在运行时获得这些信息。我需要显示所有的图像 你能告诉我怎么做吗。。图片将从互联网网址 Pavan图像将绑定到ItemsControl,然后您将使用ItemsPanel来控制每个项目的布局 请查看此链接以获取指南 这是使用from的完美案例 它基本上只需要一行代码就可以做你需要的事情。我是一个初学者,但我用了4张图片和一个全屏表单。我还没有试

专家们

我正在Windows phone中开发一个应用程序,我需要在屏幕上以表格格式显示图像(行和列中的两个图像将根据需要增长)。 图像计数将是动态的,我将在运行时获得这些信息。我需要显示所有的图像

你能告诉我怎么做吗。。图片将从互联网网址


Pavan

图像将绑定到
ItemsControl
,然后您将使用
ItemsPanel
来控制每个项目的布局


请查看此链接以获取指南

这是使用from的完美案例


它基本上只需要一行代码就可以做你需要的事情。

我是一个初学者,但我用了4张图片和一个全屏表单。我还没有试过用C#来做手机。 试试这个:)代码,它只会在anny类型的屏幕上放置4个图像,设置为启动@center of screen并将其添加到全屏模式。将4个imageBox添加到窗体并设置其图像或加载图像后,将1个图像设置为全屏的1/4:

public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Left, Screen.PrimaryScreen.WorkingArea.Top);
            this.Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
            pictureBox1.Size = new Size(this.Width - this.Width / 2, this.Height - this.Height / 2);
            pictureBox1.Location = new Point(0, 0);
            pictureBox2.Size = new Size(this.Width - this.Width / 2, this.Height - this.Height / 2);
            pictureBox2.Location = new Point(this.pictureBox1.Width,0);
            pictureBox3.Size = new Size(this.Width - this.Width / 2, this.Height - this.Height / 2);
            pictureBox3.Location = new Point(0, this.pictureBox1.Height);
            pictureBox4.Size = new Size(this.Width - this.Width / 2, this.Height - this.Height / 2);
            pictureBox4.Location = new Point(this.pictureBox2.Width, this.pictureBox3.Height);
            // this.Controls.Add(pictureBox1);
        }
    }
}

所有图像的宽度和高度是否相同?是。。所有具有相同精确尺寸的图像以前都使用WrapPanel以相同的方式订购文本项,事实上WrapPanel就是您要找的东西!:)我想以渐进的方式添加图像,因为我不知道会有多少图像..然后呢?把它们添加到一个
可观察的集合中
,一点问题都没有。谢谢克劳斯。包裹面板是寻找同类问题的最佳解决方案。。请参考此链接