Exemple #1
0
 /// <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);
     }
 }
Exemple #2
0
 /// <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);
         }
     }
 }
Exemple #3
0
        /// <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);
        }