0

現在、画像の上に黒い長方形を描画しようとしていますが、画像の下部に表示されません。押し下げようとすると、画像が黒い長方形で塗りつぶされます。

これが私のコードです:

public void AddTextToImage(string LabelText, string CardNo)
{
BitMap LabelImage = new BitMap("C:\ImageLocation");
int32 y = Convert.toInt32(CardNo;
int32 x = LabelImage.Width;

Rectangle rec = new Rectangle(Convert.ToInt32(LabelText), Convert.ToInt32(CardNo, LabelImage.Width, 250);

\\Mainly been playing with the numbers, can't figure out the right coordinates though
graphic.DrawRectangle(new Pen(Color.Black, LabelImage.Width), 0, -200, LabelImage.Width, y);

graphic.DrawString(LabelText, new Font("Tahoma", 40), Brushes.Black, new System.Drawing.Point(0,y));

picImage.Image = LabelImage;

}
4

1 に答える 1

0

使用しないでください-200。画像外になります

 graphic.DrawRectangle(new Pen(Color.Black, LabelImage.Width), 0, 200, LabelImage.Width, y);
于 2011-03-10T23:11:52.593 に答える