閱讀英文

共用方式為


RectangleF.Implicit(Rectangle to RectangleF) 運算子

定義

將指定的 Rectangle 結構轉換成 RectangleF 結構。

public static implicit operator System.Drawing.RectangleF (System.Drawing.Rectangle r);

參數

r
Rectangle

要轉換的 Rectangle 結構。

傳回

RectangleF 結構,該結構是從指定的 Rectangle 結構轉換而來。

範例

下列程式代碼範例示範如何使用 ImplicitRectangleFEquality 成員。 此範例的設計目的是要與 Windows Form 搭配使用。 將此程式代碼貼到表單中,並在處理表單的事件時呼叫 ConvertRectangleToRectangleF 方法,並e傳遞為 PaintEventArgsPaint

System.Drawing.RectanglesAndPoints#6

適用於