使用listbox然后把图象画上去如下: private void listBox1_DrawItem(object sender, DrawItemEventArgs e) 
{
try
{
Image myImage = new Bitmap(listBox1.Items[e.Index].ToString());//这里的图象可以去数据库或其他地方取
Rectangle rectImage = new Rectangle(e.Bounds.X + 1, e.Bounds.Y + 1, e.Bounds.Width - 2 , e.Bounds.Height - 2);
rectImage.Width = (int) Math.Round(myImage.Width * ((double) e.Bounds.Height / myImage.Height));
e.Graphics.DrawImage(myImage, rectImage);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
// Draws the rectangle around the selected item.
e.DrawFocusRectangle();
}

解决方案 »

  1.   

    90个LABEL一开始,我以为你是要向lable里绘图,所以建议你用listbox绘图这才看清,你是要一个一个一个。。变成透明色
      

  2.   

    90个Label??
    大哥你有没有搞错?你要实现什么功能?
    难道就不能优化一下?
    你说的以前其他语言是什么语言??
      

  3.   

    你既然要让Label透明应该使用了一个巨大的背景图片~~嘿嘿~~~
    那么也许是用了form的BackgroundImage属性~~这就是显示速度慢的原因。
    我给个例子给你,用GDI+方式显示背景图片,我试了一下,速度快很多,在我的系统里我加载了100个透明的Label~~也只是首次加载稍微有点闪烁而已。test.jpg放在编译后的可执行文件同一个目录,Enjoy it!namespace GDIBack
    {
    using System;
    using System.Windows.Forms;
    using System.IO;
    using System.Net;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Drawing.Imaging;
    using System.Drawing.Text;
    using System.Reflection; public class ImagesSample : System.Windows.Forms.Form 
    {
    /// <summary>
    ///    必需的设计器变量。
    /// </summary>
    private System.ComponentModel.Container components; private System.Drawing.Brush backgroundBrush;
    public ImagesSample() 
    {
    InitializeComponent(); Image backgroundImage;
    backgroundImage = new Bitmap("test.jpg");
    backgroundBrush = new TextureBrush(backgroundImage); } protected override void OnPaint(PaintEventArgs e) 
    {
    Graphics g = e.Graphics;
    g.FillRectangle(backgroundBrush, ClientRectangle);
    }
    /// <summary>
    ///    清理正在使用的所有资源。
    /// </summary>
    protected override void Dispose(bool disposing)
    {
    if (disposing) 
    {
    if (components != null) 
    {
    components.Dispose();
    }
    }
    base.Dispose(disposing);
    } /// <summary>
    ///    设计器支持所必需的方法,不要使用
    ///    代码编辑器修改此方法的内容。
    /// </summary>
    void InitializeComponent () 
    {
    // 
    // ImagesSample
    // 
    this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
    this.ClientSize = new System.Drawing.Size(742, 472);
    this.Name = "ImagesSample";
    this.Text = "GDI+ 背景示例"; } /// <summary>
    /// 应用程序的主入口点。
    /// </summary>
    [STAThread]
    public static void Main() 
    {
    Application.Run(new ImagesSample());
    }
    }
    }