创建无限的图像序列

时间:2013-12-03 19:42:02

标签: c# winforms for-loop

我需要创建一个无限的图像序列ex:

     string connectionLine;
                    connectionLine = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
                    MySqlConnection connection = new MySqlConnection(connectionLine);
                    MySqlCommand command = connection.CreateCommand();
                    command.CommandText = "SELECT comment_content, comment_author FROM " + wp_comments + " WHERE comment_post_ID =@iddo and comment_approved =@app";
                    command.Parameters.AddWithValue("article", article.id);
                    command.Parameters.AddWithValue("app", "1");
                    MySqlDataReader Reader;
                    try
                    {
                        connection.Open();
                        Reader = command.ExecuteReader();
                        if (Reader.HasRows == true)
                        { 
                            while (Reader.Read())
                            {
                                radListControl1.Items.Add("By: " + Reader.GetValue(1) + " - " + Reader.GetValue(0));

                                PictureBox myPicBox = new PictureBox();
                                myPicBox.Location = new Point(300, 200);
                                myPicBox.Width = 328;
                                myPicBox.Height = 131;
                                myPicBox.SizeMode = PictureBoxSizeMode.StretchImage;
                                myPicBox.Visible = true;
                                myPicBox.Image = new Bitmap(Properties.Resources.fumetto);
                                this.Controls.Add(myPicBox);

                                PictureBox myPicBox1 = new PictureBox();
                                myPicBox1.Location = new Point(myPicBox.Location.X, myPicBox.Location.Y + 100);
                                myPicBox1.Width = 328;
                                myPicBox1.Height = 131;
                                myPicBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                                myPicBox1.Visible = true;
                                myPicBox1.Image = new Bitmap(Properties.Resources.fumetto);
                                this.Controls.Add(myPicBox1);
                            }
   }
            }
            catch
            { }

但这种模式适用于2或3个元素,对于更多元素来说,计算图像距离是不可能的。

我的想法是:

enter image description here

可能吗?如何用图像之间的空间创建这种无限的图像序列?

0 个答案:

没有答案