RectangleF.Implicit(Rectangle to RectangleF) 運算子

定義

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

public:
 static operator System::Drawing::RectangleF(System::Drawing::Rectangle r);
public static implicit operator System.Drawing.RectangleF (System.Drawing.Rectangle r);
static member op_Implicit : System.Drawing.Rectangle -> System.Drawing.RectangleF
Public Shared Widening Operator CType (r As Rectangle) As RectangleF

參數

r
Rectangle

要轉換的 Rectangle 結構。

傳回

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

範例

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

System.Drawing.RectanglesAndPoints#6

適用於