This is a migrated thread and some comments may be shown as answers.

Changing Selected Image Size!

6 Answers 186 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 25 Jun 2010, 02:46 AM
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);
            }


        }

6 Answers, 1 is accepted

Sort by
0
david
Top achievements
Rank 1
answered on 25 Jun 2010, 03:07 AM
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);

        }
0
Peter
Telerik team
answered on 30 Jun 2010, 02:12 PM
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
0
Kevin
Top achievements
Rank 2
answered on 27 Jul 2012, 08:21 AM
Hmmmm,

i tried your sample project but it didnt work, just looked a mess to be honest. Huge red panels with a very small image in the middle. Didnt see anything that was dimmed.

ive a 13inch mac so it took up the entire screen, maybe you could resend the sample but make a few small adjustments :)

Thank you for your time

Regards
Kevin
0
Peter
Telerik team
answered on 30 Jul 2012, 11:33 AM
Hello Kevin,

Тhank you for contacting Telerik support.

I noticed that you have been downloading our Trial controls since 2010, but are still not our customer. 
We will be grateful if you share the reasons which prevent you from obtaining a Dev license during this period. Your feedback regarding your overall experience with our suite will be highly appreciated. If you like the product, you can purchase one of the licenses that we offer: http://www.telerik.com/purchase.aspx. These licenses comes with Dev priority support where the tickets should be answered in a guaranteed period of time. Shortly said, we will provide you with quicker responses.

In regards to your question at hand, I upgraded the application from the ticket to our latest version (2012.2.726) and everything looks good - please refer to the attached screen shot and to the upgraded application.

Could you clarify in greater details (screen shots, video) what goes wrong from your side?

Greetings,
Peter
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Kevin
Top achievements
Rank 2
answered on 30 Jul 2012, 01:10 PM
On my end the panels were huge and coloured red with very small images in the middle, nothing like the one i see now.

I have been using the trial version of your controls since 2010 because i was a student until 2012. I have now graduate and im working towards getting the cash available for a development licence. You must also bear in mind that im a hobbiest and not a developer. I build a movie application for myself, to pay 1600 per year is just mad!!

i dare you to offer me a discount :)

Kevin
0
Stefan
Telerik team
answered on 31 Jul 2012, 12:14 PM
I am glad that everything is OK now. 

In regards to the license. This is a sales related question and I will have someone from the sales team contact you via email.
 
Regards,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
Carousel
Asked by
david
Top achievements
Rank 1
Answers by
david
Top achievements
Rank 1
Peter
Telerik team
Kevin
Top achievements
Rank 2
Stefan
Telerik team
Share this question
or