ImageList.Images プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ImageList.Images プロパティの意味・解説 

ImageList.Images プロパティ

このイメージ リストの ImageList.ImageCollection を取得します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Dim instance As ImageList
Dim value As ImageCollection

value = instance.Images
public ImageCollection Images { get; }
public:
property ImageCollection^ Images {
    ImageCollection^ get ();
}
/** @property */
public ImageCollection get_Images ()
public function get Images
 () : ImageCollection

プロパティ
イメージコレクション

解説解説
使用例使用例

ImageList構築しImages プロパティイメージ追加しImageSize プロパティ設定してDraw メソッド使用するコード例次に示します。この例を実行するには、Button1 という名前のボタン配置されフォーム中にこの例を配置します。この例では、c:\Windows\ に FeatherTexture.bmp および Gone Fishing.bmp置かれていることを前提としています。これらのビットマップシステム存在しない場合、または他の場所存在する場合は、必要に応じて例を変更してください

Friend WithEvents ImageList1 As
 System.Windows.Forms.ImageList

' Create an ImageList Object, populate it, and display
' the images it contains.
Private Sub Button1_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 Button1.Click

    ' Construct the ImageList.
    ImageList1 = New ImageList

    ' Set the ImageSize property to a larger size 
    ' (the default is 16 x 16).
    ImageList1.ImageSize = New Size(112, 112)

    ' Add two images to the list.
    ImageList1.Images.Add(Image.FromFile _
        ("c:\windows\FeatherTexture.bmp"))
    ImageList1.Images.Add _
        (Image.FromFile("C:\windows\Gone Fishing.bmp"))

    Dim count As System.Int32

    ' Get a Graphics object from the form's handle.
    Dim theGraphics As Graphics = Graphics.FromHwnd(Me.Handle)

    ' Loop through the images in the list, drawing each image.
    For count = 0 To ImageList1.Images.Count
 - 1
        ImageList1.Draw(theGraphics, New Point(85, 85), count)

        ' Call Application.DoEvents to force a repaint of the form.
        Application.DoEvents()

        ' Call the Sleep method to allow the user to see the image.
        System.Threading.Thread.Sleep(1000)
    Next
End Sub

internal System.Windows.Forms.ImageList ImageList1;

// Create an ImageList Object, populate it, and display
// the images it contains.
private void Button1_Click(System.Object sender,
 
    System.EventArgs e)
{

    // Construct the ImageList.
    ImageList1 = new ImageList();

    // Set the ImageSize property to a larger size 
    // (the default is 16 x 16).
    ImageList1.ImageSize = new Size(112, 112);

    // Add two images to the list.
    ImageList1.Images.Add(
        Image.FromFile("c:\\windows\\FeatherTexture.bmp"));
    ImageList1.Images.Add(
        Image.FromFile("C:\\windows\\Gone Fishing.bmp"));

    // Get a Graphics object from the form's handle.
    Graphics theGraphics = Graphics.FromHwnd(this.Handle);

    // Loop through the images in the list, drawing each image.
    for(int count = 0; count < ImageList1.Images.Count;
 count++)
    {
        ImageList1.Draw(theGraphics, new Point(85, 85), count);

        // Call Application.DoEvents to force a repaint of the form.
        Application.DoEvents();

        // Call the Sleep method to allow the user to see the image.
        System.Threading.Thread.Sleep(1000);
    }
}

internal:
   System::Windows::Forms::ImageList^ ImageList1;

private:

   // Create an ImageList Object, populate it, and display
   // the images it contains.
   void Button1_Click( System::Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      
      // Construct the ImageList.
      ImageList1 = gcnew ImageList;
      
      // Set the ImageSize property to a larger size 
      // (the default is 16 x 16).
      ImageList1->ImageSize = System::Drawing::Size( 112, 112 );
      
      // Add two images to the list.
      ImageList1->Images->Add( Image::FromFile( "c:\\windows\\FeatherTexture.bmp"
 ) );
      ImageList1->Images->Add( Image::FromFile( "C:\\windows\\Gone Fishing.bmp"
 ) );
      
      // Get a Graphics object from the form's handle.
      Graphics^ theGraphics = Graphics::FromHwnd( this->Handle
 );
      
      // Loop through the images in the list, drawing each image.
      for ( int count = 0; count < ImageList1->Images->Count;
 count++ )
      {
         ImageList1->Draw( theGraphics, Point(85,85), count );
         
         // Call Application.DoEvents to force a repaint of the form.
         Application::DoEvents();
         
         // Call the Sleep method to allow the user to see the image.
         System::Threading::Thread::Sleep( 1000 );

      }
   }
private System.Windows.Forms.ImageList imageList1;

// Create an ImageList Object, populate it, and display
// the images it contains.
private void button1_Click(Object sender, System.EventArgs
 e)
{
    // Construct the ImageList.
    imageList1 = new ImageList();
    // Set the ImageSize property to a larger size 
    // (the default is 16 x 16).
    imageList1.set_ImageSize(new Size(112, 112));
    // Add two images to the list.
    imageList1.get_Images().Add(Image.FromFile(
        "c:\\windows\\FeatherTexture.bmp"));
    imageList1.get_Images().Add(Image.FromFile(
        "C:\\windows\\Gone Fishing.bmp"));
    // Get a Graphics object from the form's handle.
    Graphics theGraphics = Graphics.FromHwnd(this.get_Handle());
    // Loop through the images in the list, drawing each image.
    for (int count = 0; count < imageList1.get_Images().get_Count();
 
        count++) {
        imageList1.Draw(theGraphics, new Point(85, 85), count);
        // Call Application.DoEvents to force a repaint of the form.
        Application.DoEvents();
        // Call the Sleep method to allow the user to see the image.
        System.Threading.Thread.Sleep(1000);
    }
} //button1_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「ImageList.Images プロパティ」の関連用語

ImageList.Images プロパティのお隣キーワード
検索ランキング

   

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



ImageList.Images プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS