Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Carousel > Changing Selected Image Size!

Not answered Changing Selected Image Size!

Feed from this thread
  • david avatar

    Posted on Jun 24, 2010 (permalink)

    Hi,

    I am just getting to terms with the carousal and its working great. There is just a couple of things I am trying to get right. Maybe you can help me.

    I have created some test code which adds the image list at runtime just looking at a directory. Code is displayed below. The code works fine but all the items are the same size. What I need is the selected item to be a larger size so they stand out from the rest. Also if its not too much work I want the rest of the items in the background to be slightly dimmed out just to emphasize on this.

    PLEASE HELP...

    Thanks



    private void CreateCarouselItems()
            {


                //pictureBox2.Image = Image.FromFile("D:\\IMAGES\\1.jpg");

                int[] myInterger = new int[1];
                for (int i = 1; i < 100; i++)
                {
                    RadButtonElement carouselItem = new RadButtonElement();
                    carouselItem.ImageAlignment = ContentAlignment.MiddleCenter;
                    carouselItem.TextAlignment = ContentAlignment.MiddleCenter;
                    carouselItem.TextImageRelation = TextImageRelation.ImageAboveText;
                    carouselItem.ShowBorder = true;
                    carouselItem.Text = "Peter Pan";
                    carouselItem.ForeColor = Color.WhiteSmoke;
                    carouselItem.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;

                    carouselItem.BackColor = Color.YellowGreen;


                    Bitmap b;
                    b = (Bitmap)Image.FromFile("D:\\IMAGES\\" + i.ToString() + ".jpg");
                    carouselItem.Image = ResizeBitmap(b, 90, 60);


                    this.radCarousel1.Items.Add(carouselItem);
                }


            }

    Reply

  • david avatar

    Posted on Jun 24, 2010 (permalink)

    Ok,

    I have had some luck in the selected index change even. But the only problem is that when the item I made larger moves along it remembers its image size so I guess I also need to reset all the other items as well as the selected item. I still have no idea how to dim out the unselected items. This is the code I have got so far...

    private void radCarousel1_SelectedIndexChanged(object sender, EventArgs e)
            {
                RadButtonElement carouselItem = (RadButtonElement)radCarousel1.SelectedItem;
                Bitmap b;
                b = (Bitmap)Image.FromFile("D:\\IMAGES\\" + "2" + ".jpg");
                carouselItem.Image = ResizeBitmap(b, 150, 100);

            }

    Reply

  • Peter Peter admin's avatar

    Posted on Jun 30, 2010 (permalink)

    Hi david,

    Thanks for writing.

    I have prepared a small example on how you can dim and resize background pictures.

    Hope this helps.

    Greetings,
    Peter
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Attached files

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Carousel > Changing Selected Image Size!
Related resources for "Changing Selected Image Size!"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]