/// <summary> /// This checks if a shadow is already generated /// </summary> /// <param name="shadow"></param> private void CheckShadow(bool shadow) { if (shadow && shadowBitmap == null) { shadowBitmap = ImageHelper.ApplyEffect(image, new DropShadowEffect(), out shadowOffset); } }
/// <summary> /// This checks if a shadow is already generated /// </summary> /// <param name="shadow"></param> private void CheckShadow(bool shadow) { if (shadow && _shadowBitmap == null) { using (var matrix = new Matrix()) { _shadowBitmap = ImageHelper.ApplyEffect(image, new DropShadowEffect(), matrix); } } }
/// <summary> /// Make sure the content is also transformed. /// </summary> /// <param name="matrix"></param> public override void Transform(Matrix matrix) { int rotateAngle = CalculateAngle(matrix); // we currently assume only one transformation has been made. if (rotateAngle != 0) { LOG.DebugFormat("Rotating element with {0} degrees.", rotateAngle); DisposeShadow(); using (var tmpMatrix = new Matrix()) { using (Image tmpImage = image) { image = ImageHelper.ApplyEffect(image, new RotateEffect(rotateAngle), tmpMatrix); } } } base.Transform(matrix); }