public Bitmap GetAsBitmapEx(bool doArrangeAndMeasure, RadElement element, SizeF availableSize, SizeF finalSize, Brush brush, float totalAngle, SizeF totalScale) { RadElement parent = element.Parent; int indexInChildrenCollection = -1; if (parent != null) { indexInChildrenCollection = parent.Children.IndexOf(element); } this.RootElement.Children.Add(element); if (doArrangeAndMeasure) { element.ResetLayout(true); element.Measure(availableSize); element.Arrange(new RectangleF(new PointF(0, 0), finalSize)); } Bitmap bitmap = element.GetAsBitmapEx(brush, totalAngle, totalScale); //add the element to its previous parent (it will be automatically removed from its current parent) if (parent != null) { parent.Children.Insert(indexInChildrenCollection, element); } else { this.RootElement.Children.Remove(element); } return(bitmap); }
public Bitmap GetAsBitmapEx( bool doArrangeAndMeasure, RadElement element, SizeF availableSize, SizeF finalSize, Brush brush, float totalAngle, SizeF totalScale) { RadElement parent = element.Parent; int index = -1; if (parent != null) { index = parent.Children.IndexOf(element); } this.RootElement.Children.Add(element); if (doArrangeAndMeasure) { element.ResetLayout(true); element.Measure(availableSize); element.Arrange(new RectangleF(new PointF(0.0f, 0.0f), finalSize)); } Bitmap asBitmapEx = element.GetAsBitmapEx(brush, totalAngle, totalScale); if (parent != null) { parent.Children.Insert(index, element); } else { this.RootElement.Children.Remove(element); } return(asBitmapEx); }