Click here to Skip to main content
15,917,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
<pre>  private void button1_Click(object sender, EventArgs e)
        {
          



            System.Windows.Forms.FolderBrowserDialog openFolder = new System.Windows.Forms.FolderBrowserDialog();
            if (openFolder.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
               
                
                
                string Dirpath = openFolder.SelectedPath;
                images = Directory.GetFiles(Dirpath, "*.Jpg");
                imageIX = 0;
            }
            timer1.Interval = 5000;// int.Parse(comboBox1.Text) * 1000;
            timer1.Start();

        }
    

        private void timer1_Tick(object sender, EventArgs e)
        {
            

            // Sets up an image object to be displayed.
            if (MyImage != null)
            {
                MyImage.Dispose();
            }
        
            try
            {
                MyImage = new Bitmap(images[imageIX]);
               
            }
            catch (Exception)
            {
                
            }
          
            // Stretches the image to fit the pictureBox.

            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            pictureBox1.Image = (Image)MyImage;
            imageIX++;
            if (imageIX > 10)
                timer1.Stop();

        }




This is my image slide show code

What I have tried:

C#
private void button1_Click(object sender, EventArgs e)
       {
           string slideID = "";
           int slideposX = 50;
           int slideposY = 50;



           System.Windows.Forms.FolderBrowserDialog openFolder = new System.Windows.Forms.FolderBrowserDialog();
           if (openFolder.ShowDialog() == System.Windows.Forms.DialogResult.OK)
           {


               m_objEditor.CGObject.AddNewItem(openFolder.SelectedPath, slideposX, slideposY, 0, 1, ref slideID);
               m_objEditor.UpdateItemsList();
               string Dirpath = openFolder.SelectedPath;
               images = Directory.GetFiles(Dirpath, "*.Jpg");
               imageIX = 0;
           }
           timer1.Interval = 5000;// int.Parse(comboBox1.Text) * 1000;
           timer1.Start();

       }


I am trying like this but image not show slide by slide in m_objEditor window.Picture box working slide by slide
Posted
Comments
Richard MacCutchan 27-Mar-21 4:07am    
What is m_objEditor?
Jnkukka 27-Mar-21 4:09am    
medialooks mplatform preview window
Jnkukka 27-Mar-21 4:21am    
I cannot find anything related to this issue.
Richard MacCutchan 27-Mar-21 4:40am    
Sorry, I have never heard of that library before today, so cannot offer any suggestions.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900