I have an array of WriteableBitmaps and would like to bind it to the coverflow in order to look at the images. I'm trying to bind it to this collection but nothing gets shown up. What i'm missing?
I've tried to bind to an WriteableBitmap Array and to an Image array but neither worked.
8 Answers, 1 is accepted
Image[] imgs = new Image[5];
imgs[0] =
new Image();
BitmapImage bi3 = new BitmapImage();
bi3.UriSource =
new Uri("Images/Img1.Jpg", UriKind.Relative);
imgs[0].Source = bi3;
imgs[1] =
new Image();
bi3 =
new BitmapImage();
bi3.UriSource =
new Uri("Images/Img2.Jpg", UriKind.Relative);
imgs[1].Source = bi3;
imgs[2] =
new Image();
bi3 =
new BitmapImage();
bi3.UriSource =
new Uri("Images/Img3.Jpg", UriKind.Relative);
imgs[2].Source = bi3;
imgs[3] =
new Image();
bi3 =
new BitmapImage();
bi3.UriSource =
new Uri("Images/Img4.Jpg", UriKind.Relative);
imgs[3].Source = bi3;
//This is the part that doesn't work
WriteableBitmap w = new WriteableBitmap(Convert.ToInt32(element.ActualWidth), Convert.ToInt32(element.ActualHeight), PixelFormats.Bgr32);
w.Render(element,
new ScaleTransform());
imgs[4] = new Image();
imgs[4].Source = w;
//End
coverFlow.ItemsSource = imgs;
What happens is that the first 4 images gets shown but, the last one, built on the fly, does not... Any ideas?
You can try to work it around by creating List of ImageSources and when all the images are created to set the list to the CoverFlow ItemsSource property. I'm afraid we cannot guarantee that this will work as the control is not tested with this feature completely but I will be happy to get your feedback if you follow the described approach.
Regards,
Miroslav Nedyalkov
the Telerik team
Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
BitmapSource or BitMapImage that would work.
We added this feature in our TO-DO plans for CoverFlow control and we will do our best to implement for futures version of the control.
Thank you for your involvement.
Regards,
Rosi
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.
I just evaluated 00395RadControls_for_Silverlight4_2009_3_1322_Trial.zip. It still seems not to work.
Do you plan to support in-memory images?
Regards,
Wolfgang
It should work actually. Problem occurs when you put the images directly in RadCoverFlow, because it attaches a handler to the ImageLoaded event and hides the image, in order to display the "loading" animation. Since the images with in-memory source never fire that event, RadCoverFlow never shows the real image. The workaround is to wrap the Image into a Border or a Grid, for example, which will prevent RadCoverFlow from hiding it automatically. More information can be found in the following thread:
http://www.telerik.com/community/forums/silverlight/coverflow/coverflow-not-work-with-memorystream-why.aspx
Best wishes,
Valeri Hristov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.