首先我实在一个picturebox 中load一个picture
然后利用 transparentblt picDest.hdc,picSource.hdc,0,0,bmp.bmWidth,bmp.bmWith,0,0,cTransparent
对图像中的某种颜色进行透明处理,并把处理后显示在picDest中,但是现在我用
savepicture picDest.Image,"c:\11.bmp"
但是保存下来却什么都没有!!只把picDest众的底色保存下来了
我后来又在论坛上看到一篇帖子,利用去API区DC,然后再把DC变成图片,
这样实验是能把图片保存起来,可是,这样的话,图片中的经过透明处理去掉的颜色却全部变成picDest的背景色了,走了一圈,又回到了原点,怎么解决呢,请各位帮忙了啊,谢谢

解决方案 »

  1.   

    bmp文件怕是不能带透明效果的吧
    一般透明的部份都会用背景色代替,看看有什么办法存成GIF的吧
      

  2.   

    vb.net里面Bitmap对象有Save的方法
      

  3.   

    GIF支持透明色,BMP不支持透明色.
      

  4.   

    用picturebox.picture不能保存吗?
      

  5.   

    要保存picDest.Image,前提是picDest的AutoRedraw设为True,否则,只是背景色!
      

  6.   

    Private Sub baocun_Click()
    Picture1.AutoRedraw = True
    On Error GoTo err
    CommonDialog1.Filter = "bmp files(*.bmp)|*.bmp|all files(*.*)|*.*|gif files(*.gif)|*.gif|txt files(*.txt)|*.txt|"
    CommonDialog1.FileName = ""
    CommonDialog1.DialogTitle = "保存"
    CommonDialog1.ShowSave
    If CommonDialog1.FileName <> "" Then
    SavePicture Picture1.Image, CommonDialog1.FileName
    End If
    err:
    Exit Sub
    End Sub
      

  7.   

    保存前加一句set Picture1.picture=Picture1.Image