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

Carousel - Images

2 Answers 130 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
chaily pardes
Top achievements
Rank 1
chaily pardes asked on 18 Aug 2009, 02:02 PM
Hi,
We want to buy your product so we try it now to see if it's feet us.
we want a carousel with images,The images will be added in runtime
here is my code:
--------------------------------------------------------------------------------------------------------------------------------------------

RadButtonElement

 

radB = new RadButtonElement();

 

 

 

Image Image = SaveBitmap(f); //My Faunction which returns an image

 

radB.CanFocus =

true;

 

 

 

radB.DisplayStyle = Telerik.WinControls.

 

 

DisplayStyle.Image;

 

 

radB.Image = Image;

radB.Name =

"radButtonElement";

 

 

 

radB.Text =

"radButtonElement";

 

 

 

((Telerik.WinControls.Primitives.

 

 

FillPrimitive)(radB.GetChildAt(0))).Visibility = Telerik.WinControls.ElementVisibility.Hidden;

 

((Telerik.WinControls.Primitives.

 

BorderPrimitive)(radB.GetChildAt(2))).Visibility = Telerik.WinControls.ElementVisibility.Hidden;

 

 

 

this.leoSchachterCarousel1.Items.Add(radB);
---------------------------------------------------------------------------------------------------------------------------------------

the Problem Is that the Image is to big and when I set it smaller it is cut...
how can I set an AutoSize and Stretch Image to RadButtonElement ?
Thank You,

 

 

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 18 Aug 2009, 02:41 PM
Hi chaily pardes,

Thank you for writing.Yes, you can set the button element AutoSize to True -- in this case the button element size will be equal to the image size:

radB.AutoSize = true

Also, you can re-size images to proper sizes using this line of code:

radB.Image = new Bitmap( SaveBitmap(f), 20,20);  

I hope this helps. Don't hesitate to contact us if you have other questions.

Greetings,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
chaily pardes
Top achievements
Rank 1
answered on 19 Aug 2009, 11:42 AM
Perfect!!!
Thank you
Tags
Carousel
Asked by
chaily pardes
Top achievements
Rank 1
Answers by
Peter
Telerik team
chaily pardes
Top achievements
Rank 1
Share this question
or