如题:
求任何可能解决该问题的方法:
我的图片是运行时加载的,加载路径是通过数据库读取的。。我窗体上有个背景图,然后几个PICBOX  。。背景图加载很快,而且图也很大。。
但是这几个PICBOX加载时就能看到延时,就跟网页刷新一样。图片我设了透明背景,,但是两张图片重叠的时候就能看到方形的背景了。
求任何可能解决该问题的方法:

解决方案 »

  1.   

    1 你那两张图形是透明的图形不.
    2 如果是 你必须设置 显示你图形的PICTUREBOX的父容器是 背景的PICTUREBOX..透明只是对父容器的颜色.而不是同级覆盖在下面控件的颜色.也就是说  backPictureBox.Controls.Add(PictureBox) 这样来做.
    3 速度慢..这个问题有很多.一时间说不清楚..你可以这样考虑 使用Gdi+ 先绘制背景图.然后绘制张长图片..绘制到一个BITMAP 然后再显示到界面..这样也可以解决透明的问题.
      

  2.   

    这个问题还是不要用直接用多个PictureBox设置Image实现,可以用一个PictureBox在Paint函数里面自己处理后绘出来吧如果是要整个窗口都绘,可以不用PictureBox,直接在Form的Paint里面绘
      

  3.   


    这个和你用Paint() 没关系  Paint里的方法你可以写成变量形式的.
      

  4.   

    我刚写了个Demo,看看是不是你想要的 
    http://topic.csdn.net/u/20090414/15/fabf4268-4b43-4133-b89b-9807be056444.html
      

  5.   

    可以截PICBOX大小的图然后作为PICBOX的背景
      

  6.   

    楼主请看这里:
    http://www.itstrike.cn/Home.mvc/Search/?key=GDI
      

  7.   

    pictureBox 只能这样了, 以前做一个英雄打怪物的小游戏时,设了窗口背景图,pictureBox里放的是图片,背景透明, 而在移动时发现,图片每次变换位置都带着上次的背景, 这不是pictrueBox的问题,老师说游戏公司都用一种什么技术可以解决,有点复杂,  把窗体设为mdi容器~~背景色你再变一下试试行不行
      

  8.   

    c# 在picturebox上面放一些label,使label背景色变得透明
    2008-07-13 15:47
    private void picturebox1_Paint(object sender, PaintEventArgs e)
            {
                foreach (Control C in this.Controls)
                {                if (C is Label)
                    {                    Label L = (Label)C;                    L.Visible = false;                    e.Graphics.DrawString(L.Text, L.Font, new          SolidBrush(L.ForeColor), L.Left - picturebox1.Left, L.Top - picturebox1.Top);                }            }        }
      

  9.   

    通过API实现或参考
    参考
    参考
      

  10.   

    用photoshop,让两张图片叠加,把结果加载,应该可以节省点时间!
      

  11.   

    public static unsafe void ConvertTransparancyGif(int colorIndex, string baseFile, string outputFile)
    {
        using (FileStream fs = new FileStream(baseFile, FileMode.Open, FileAccess.Read))
        {
            Bitmap img = (Bitmap)Image.FromStream(fs, false, false);
            int width = img.Width;
            int height = img.Height;        Bitmap resultbmp = new Bitmap(width, height, PixelFormat.Format8bppIndexed);
            ColorPalette palette = resultbmp.Palette;
            int n = 0;
            foreach (Color tc in img.Palette.Entries)
            {
                palette.Entries[n] = Color.FromArgb(255, tc);
                n++;
            }        palette.Entries[colorIndex] = Color.FromArgb(0, palette.Entries[colorIndex]);
            resultbmp.Palette = palette;        //now to copy the actual bitmap data 
            BitmapData src = img.LockBits(
                new Rectangle(0, 0, width, height),
                ImageLockMode.ReadOnly,
                img.PixelFormat);        BitmapData dst = resultbmp.LockBits(
                new Rectangle(0, 0, width, height),
                ImageLockMode.WriteOnly,
                resultbmp.PixelFormat);        byte* pSrc = (byte*)src.Scan0.ToPointer();
            byte* pDst = (byte*)dst.Scan0.ToPointer();
            int offset = src.Stride - width;        //steps through each pixel 
            for (int y = 0; y < height; y++)
            {
                for (int x = 0; x < width; x++)
                {
                    pDst[0] = pSrc[0];
                    pDst++;
                    pSrc++;
                }
                pDst += offset;
                pSrc += offset;
            }        //unlock the bitmaps 
            img.UnlockBits(src);
            resultbmp.UnlockBits(dst);        resultbmp.Save(outputFile, ImageFormat.Gif);        img.Dispose();
            resultbmp.Dispose();
        } 
    }