说来有趣,98年的时候,我玩directdraw,当时记得我在fastblt或者类似的函数里面设置了一下alpha值,然后退出程序的时候,整个windows都变成半透明的了,呵呵.至今不明白其中的道理...

解决方案 »

  1.   

    VB的例程,想要吗?参考一下也好!Public Sub MakeTranslucent(Who As Form, Optional tColor As Long) 'Was (Who as Object) before...On Local Error Resume NextDim HW As Long
    Dim HA As Long
    Dim iLeft As Integer
    Dim iTop As Integer
    Dim iWidth As Integer
    Dim iHeight As IntegerIf IsMissing(tColor) Or tColor = 0 Then
        tColor = RGB(0, 0, 200)
    End IfWho.AutoRedraw = True
    Who.HideDoEventsHW = GetDesktopWindow()
    HA = GetDC(HW)'Get the Left, Top, Width and Height of the Form...
    iLeft = Who.Left / Screen.TwipsPerPixelX
    iTop = Who.Top / Screen.TwipsPerPixelY '+ 25    If using a form with a titlebar (border)...
    iWidth = Who.ScaleWidth
    iHeight = Who.ScaleHeight'Now, Transfer the contents of the Desktop Window to the Form...
    Call BitBlt(Who.hdc, 0, 0, iWidth, iHeight, HA, iLeft, iTop, SRCCOPY) 'iLeft + 4    If using a form with a titlebar (border)...'Show...
    Who.Picture = Who.Image
    Who.Show'Release the DC...
    Call ReleaseDC(HW, HA)'Add color...
    Who.DrawMode = 9
    Who.ForeColor = tColor
    Who.Line (0, 0)-(iWidth, iHeight), , BFEnd Sub加入以上声明后在程序里调用方法:Call MakeTranslucent(Form1, tColor)
      

  2.   

    在9x中似乎只有抓图一种方法,在2000中应该可以设置ex_style。
      

  3.   

    哈哈,其实太简单了,不就是一个api函数吗?但告诉你,Windows 9x是不支持的。
      

  4.   

    我上面的函数可以在win98/95下使用!!!!!不然就不写了!