Currently, RadPictureBox supports the gif format, but the animated gifs are not animated like the standard MS PictureBox.
Workaround: use a RadLabel to show the animated gif:
this.radLabel1.LabelElement.Image = Properties.Resources.giphy;
at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.DrawPath(Pen pen, GraphicsPath path) at Telerik.WinControls.Svg.SvgRenderer.DrawPath(Pen pen, GraphicsPath path) at Telerik.WinControls.Svg.SvgVisualElement.RenderStroke(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgMarkerElement.RenderStroke(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgVisualElement.RenderFillAndStroke(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgVisualElement.Render(ISvgRenderer renderer, Boolean renderFilter) at Telerik.WinControls.Svg.SvgVisualElement.Render(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgElement.RenderChildren(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgVisualElement.Render(ISvgRenderer renderer, Boolean renderFilter) at Telerik.WinControls.Svg.SvgGroup.Render(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgElement.RenderChildren(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgVisualElement.Render(ISvgRenderer renderer, Boolean renderFilter) at Telerik.WinControls.Svg.SvgGroup.Render(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgElement.RenderChildren(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgVisualElement.Render(ISvgRenderer renderer, Boolean renderFilter) at Telerik.WinControls.Svg.SvgGroup.Render(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgElement.RenderChildren(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgElement.Render(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgFragment.Render(ISvgRenderer renderer) at Telerik.WinControls.Svg.SvgDocument.Draw(Int32 rasterWidth, Int32 rasterHeight) at Telerik.WinControls.RadSvgImage.GetRasterImage(Int32 width, Int32 height, Boolean cache) at Telerik.WinControls.Primitives.ImagePrimitiveImpl.PaintZoomSvgImage(IGraphics graphics, RadSvgImage svgImage, RectangleF rect, Single opacity, Size svgImageSize) at Telerik.WinControls.UI.PictureBoxCanvasElement.PaintOwnerSvgImage(IGraphics graphics) at Telerik.WinControls.UI.PictureBoxCanvasElement.PaintElement(IGraphics graphics, Single angle, SizeF scale) at Telerik.WinControls.RadElement.DoOwnPaint(IGraphics graphics, Single angle, SizeF scale) at Telerik.WinControls.RadElement.Paint(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation) at Telerik.WinControls.RadItem.PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation) at Telerik.WinControls.RadElement.PaintChild(RadElement child, IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation) at Telerik.WinControls.RadElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation) at Telerik.WinControls.VisualElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation) at Telerik.WinControls.RadElement.Paint(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation) at Telerik.WinControls.RadItem.PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation) at Telerik.WinControls.RadElement.PaintChild(RadElement child, IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation) at Telerik.WinControls.RadElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation) at Telerik.WinControls.VisualElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation) at Telerik.WinControls.RadElement.Paint(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation) at Telerik.WinControls.RadItem.PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation) at Telerik.WinControls.RadControl.OnPaint(PaintEventArgs e) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at Telerik.WinControls.RadControl.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Steps to reproduce:
1. Copy an image with a transparent background to the Clipboard
2. Paste it in RadPictureBox.
As a result you will notice that the transparency is lost.
Note: it is possible to handle clicking the Paste menu item and control what image exactly to be pasted:
public RadForm1()
{
InitializeComponent();
this.radPictureBox1.ContextMenuItemClick += RadPictureBox1_ContextMenuItemClick;
}
private void RadPictureBox1_ContextMenuItemClick(object sender, HandledEventArgs e)
{
if (sender == this.radPictureBox1.ContextMenuProperties.PasteItem)
{
e.Handled = true;
// Image extractedImage = // get image with transparency;
// this.radPictureBox1.Image = extractedImage;
}
}