在TImageList中,主要是想将图片加到TImageList中!

解决方案 »

  1.   

    Image, Mask都是自定义的TBitmap  
      

  2.   

    晕倒,那么你说前面的image是什么意思啊:)
      

  3.   

    procedure TFormForeignCurr.LoadImageList();
    var
      str : string ;
      f1 : Textfile ;
      dirname : string ;       // directory name;
      s : string ;
      bmp1 : Tbitmap ;
      bitmap : Tbitmap ;
    begin
      Bitmap := TBitmap.Create ;
      bmp1 := TBitmap.Create ;
      // read ini file ;
      getdir (0,dirname);
      str := dirname + '\Picture\' ;
      AssignFile(f1 ,str+'bitmap.ini') ;
      reset (f1);
      while not eof(f1) do
      begin
        readln(f1, s ) ;
        bitmap.LoadFromFile(str+s) ;
        ImageList1.Add(bitmap) ;
      end ;
      closefile(f1);
    end;
    这是我的程序,在Add中出错!
      

  4.   

    那里有function Add(Image, Mask: TBitmap): Integer;????
      

  5.   

    ImageList1.Add(bitmap)调用function Add(Image, Mask: TBitmap): Integer!
    我运行的时候出错!
    好象是少了一个参数Mask!这个问题一直头痛!
     
      

  6.   

    帮助里不是有吗?
    Use the Add method to add images with their masks to an image list. It returns the index of the added image, or -1 if it fails. When the Masked property of the image list is False, the second bitmap is ignored; it can be set to nil.
      

  7.   

    哥哥,是不是我自定义一个mask:Tbitmap就行了?
      

  8.   

    哥哥! 你不说想用MASK去干啥,谁也不知道MASK是干啥的不过从一般理解,MASK是一个遮光板,去遮Image图象的,如果去掉MASK里黑的部分,在Image里黑的那部分就是透明的
      

  9.   

    对不起!我有点痴呆了!因为我有4天没和眼了!帮我看看我上面的程序好吗?主要是想将几个bitmap放入到一个Timagelist中,然后通过点击Tstringgrid的cell来选择bmp!谢谢!