ColorBlend コンストラクタ ()とは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ColorBlend コンストラクタ ()の意味・解説 

ColorBlend コンストラクタ ()

ColorBlend クラス新しインスタンス初期化します。

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

public ColorBlend ()
public:
ColorBlend ()
public ColorBlend ()
使用例使用例

Windows フォーム環境使用するための例を次に示しますColorBlend クラスを LinearGradientBrush クラス組み合わせて使用しブレンドされ楕円画面描画する方法示してます。この楕円左側が緑で、色のブレンドによって黄色になってから青になり、最後に右側で赤になります。これは、Colors プロパティPositions プロパティ使用される myColors 配列myPositions 配列設定によって行われますlgBrush2 という名前の LinearGradientBrush オブジェクトの InterpolationColors プロパティは、ColorBlend オブジェクトmyBlend等価になっている必要があります

Protected Overrides Sub
 OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
    ' Draw ellipse using ColorBlend.
    Dim startPoint2 As New
 Point(20, 110)
    Dim endPoint2 As New
 Point(140, 110)
    Dim myColors As Color() = {Color.Green,
 Color.Yellow, _
    Color.Yellow, Color.Blue, Color.Red, Color.Red}
    Dim myPositions As Single()
 = {0.0F, 0.2F, 0.4F, 0.6F, 0.8F, 1.0F}
    Dim myBlend As New ColorBlend
    myBlend.Colors = myColors
    myBlend.Positions = myPositions
    Dim lgBrush2 As New
 LinearGradientBrush(startPoint2, endPoint2, _
    Color.Green, Color.Red)
    lgBrush2.InterpolationColors = myBlend
    Dim ellipseRect2 As New
 Rectangle(20, 110, 120, 80)
    e.Graphics.FillEllipse(lgBrush2, ellipseRect2)
End Sub
protected override void OnPaint(PaintEventArgs
 e)
{
             
    //Draw ellipse using ColorBlend.
    Point startPoint2 = new Point(20, 110);
    Point endPoint2 = new Point(140, 110);
    Color[] myColors = {Color.Green,
                           Color.Yellow,
                           Color.Yellow,
                           Color.Blue,
                           Color.Red,
                           Color.Red};
    float[] myPositions = {0.0f,.20f,.40f,.60f,.80f,1.0f};
    ColorBlend myBlend = new ColorBlend();
    myBlend.Colors = myColors;
    myBlend.Positions = myPositions;
    LinearGradientBrush lgBrush2 = new LinearGradientBrush(startPoint2
,
        endPoint2,
        Color.Green,
        Color.Red);
    lgBrush2.InterpolationColors = myBlend;
    Rectangle ellipseRect2 = new Rectangle(20, 110, 120, 80);
    e.Graphics.FillEllipse(lgBrush2, ellipseRect2);
}
protected:
   virtual void OnPaint( PaintEventArgs^ e ) override
   {
      //Draw ellipse using ColorBlend.
      Point startPoint2 = Point(20,110);
      Point endPoint2 = Point(140,110);
      array<Color>^ myColors =
            {Color::Green,Color::Yellow,Color::Yellow,Color::Blue,Color::Red,Color::Red};
      array<Single>^myPositions = {0.0f,.20f,.40f,.60f,.80f,1.0f};
      ColorBlend^ myBlend = gcnew ColorBlend;
      myBlend->Colors = myColors;
      myBlend->Positions = myPositions;
      LinearGradientBrush^ lgBrush2 =
            gcnew LinearGradientBrush( startPoint2,endPoint2,Color::Green,Color::Red
 );
      lgBrush2->InterpolationColors = myBlend;
      Rectangle ellipseRect2 = Rectangle(20,110,120,80);
      e->Graphics->FillEllipse( lgBrush2, ellipseRect2 );
   }
protected void OnPaint(PaintEventArgs e)
{
    //Draw ellipse using ColorBlend.
    Point startPoint2 = new Point(20, 110);
    Point endPoint2 = new Point(140, 110);
    Color myColors[] = { Color.get_Green(), Color.get_Yellow(), 
                        Color.get_Yellow(), Color.get_Blue(), 
                        Color.get_Red(), Color.get_Red() };
    float myPositions[] =  { 0.0F, 0.2F, 0.4F, 0.6F, 0.8F, 1.0F
 };
    ColorBlend myBlend = new ColorBlend();

    myBlend.set_Colors(myColors);
    myBlend.set_Positions(myPositions);

    LinearGradientBrush lgBrush2 = new LinearGradientBrush(startPoint2
, 
        endPoint2, Color.get_Green(), Color.get_Red());

    lgBrush2.set_InterpolationColors(myBlend);

    Rectangle ellipseRect2 = new Rectangle(20, 110, 120, 80);

    e.get_Graphics().FillEllipse(lgBrush2, ellipseRect2);
} //OnPaint
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ColorBlend クラス
ColorBlend メンバ
System.Drawing.Drawing2D 名前空間

ColorBlend コンストラクタ (Int32)


ColorBlend コンストラクタ

ColorBlend クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

参照参照

関連項目

ColorBlend クラス
ColorBlend メンバ
System.Drawing.Drawing2D 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ColorBlend コンストラクタ ()」の関連用語

ColorBlend コンストラクタ ()のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ColorBlend コンストラクタ ()のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS