[問題] 應該算是圖檔的小問題
小弟最近寫程式遇到了一個瓶頸
找很多網站也不知道該怎麼解決
以下是小弟目前的程式片段
private void CreateCheckCodeImage(string checkCode)
{
if (checkCode == null || checkCode.Trim() == String.Empty)
return;
System.Drawing.Bitmap image = new
System.Drawing.Bitmap((int)Math.Ceiling((checkCode.Length * 15)), 20);
Graphics g = Graphics.FromImage(image);
問題在第六行的Math.Ceiling((checkCode.Length * 15)), 20);
這裡執行時會出現以下這個錯誤
在下列方法或屬性之間的呼叫模稜兩可: 'System.Math.Ceiling(decimal)' 和
System.Math.Ceiling(double)
我研究很久也不知道該改哪邊
小弟在猜想可能是int和Ceiling起衝突
可是不知道該怎麼做
有版上大大能指導一下小弟嗎? 感激不盡!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.44.8.121
推
09/09 08:04, , 1F
09/09 08:04, 1F
→
09/09 10:59, , 2F
09/09 10:59, 2F
→
09/09 10:59, , 3F
09/09 10:59, 3F