要用什么代码可以实现?
要用什么代码可以实现?
 2007-01-18 22:09
	    2007-01-18 22:09
   2007-01-19 09:10
	    2007-01-19 09:10
  
 2007-01-19 11:33
	    2007-01-19 11:33
  
 2007-01-19 11:40
	    2007-01-19 11:40
  Private Declare Function SetLayeredWindowAttributes Lib "User32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Public Sub NTSetfrmRgn()
'-------------------------------------------------
' 确定窗体形状及透明度
' Color 取得0,0处象素的颜色,即要裁减的区域的颜色
' SetLayeredWindowAttributes 设置透明度及窗体形状
'-------------------------------------------------
Dim WindowExs As Long
Set FormPic = LoadPicture(FormFile) '"pic\test.bmp")
FClock.Picture = FormPic
FClock.Height = ScaleY(FormPic.Height, vbHimetric, vbTwips) '把图像大小的Himetric(0.01毫米)单位变为twips单位
FClock.Width = ScaleX(FormPic.Width, vbHimetric, vbTwips)
Color = GetPixel(FClock.hdc, 0, 0) ' 这里是取图片左上角的象素颜色作为去除色,当然如果只做透明就不用!
WindowExs = GetWindowLong(FClock.hwnd, GWL_EXSTYLE)
WindowExs = WindowExs Or WS_EX_LAYERED
SetWindowLong FClock.hwnd, GWL_EXSTYLE, WindowExs
SetLayeredWindowAttributes FClock.hwnd, Color, 255, LWA_ALPHA Or LWA_COLORKEY '255就是透明度,可以调整!!
End Sub

 2007-01-19 11:49
	    2007-01-19 11:49
   2007-01-19 13:48
	    2007-01-19 13:48
   2007-01-19 14:07
	    2007-01-19 14:07
  不是透明的图片,是透明的控件PictureBox
原因是这样的,在完成了大量的编程工作之后,发现还需要添加PictureBox控件,结果发现这控件挡住了其它控件上的图片,所以要让该控件透明,否则一切都要重新开始.所有编好的图片都要重新来一遍
 2007-01-19 20:28
	    2007-01-19 20:28