看板 Programming 關於我們 聯絡資訊
※ 引述《mygame.bbs@bbs.ccns.ncku.edu.tw (逛逛)》之銘言: : public RectangleF GetCollisionMBR() : { : //... : return bCollisionMBRExists ? rfCollisionBoundingBox : null; : } ↑ ↑ : bool RectangleF : 跑出錯誤 : Type of conditional expression cannot be determined because there is no : implicit conversion between 'System.Drawing.RectangleF' and '<null>' : 請問這裡要怎麼改? : 感謝大德! RectangleF是struct而不是object, 因此請用RectangleF.Empty代替. 就像用System.IntPtr時用IntPtr.Zero一樣, struct的話很多時候 都不是nullable type, 而需要用特定的member表示「非正常」的值... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 202.134.126.84