簡體   English   中英

無法使矩形顯示在圖像的底部

[英]Can't get rectangle to show up on the bottom of the image

我目前正在嘗試在圖像上繪制黑色矩形,但它不會進入圖像的底部。 如果我嘗試將其向下推,它將僅用黑色矩形填充圖像。

這是我的代碼:

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;

}

不要使用-200 它將在圖像之外

 graphic.DrawRectangle(new Pen(Color.Black, LabelImage.Width), 0, 200, LabelImage.Width, y);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM