How to generate shadow under words on an image
问题 public static System.Drawing.Image GenerateGiftCard(String text, Font font, Color textColor) { System.Drawing.Image img = Bitmap.FromFile(@"G:\xxx\images\gift-card.jpg"); Graphics drawing = Graphics.FromImage(img); //measure the string to see how big the image needs to be SizeF textSize = drawing.MeasureString(text, font); //create a brush for the text Brush textBrush = new SolidBrush(textColor); float x, y; x = img.Width / 2 - textSize.Width / 2; y = img.Height / 2 - textSize.Height / 2;