中的透明度只能通过定义画刷来完成,但是效果不好的.
try
dim g as Graphics
dim myBrush as Brush
dim MyFiler as String="*.jpg"
dim MyImage as image=image.FromFile(MyFileName)
g=Me.Panel1.CreateGraphics()
g.SmoothingMode=System.Drawing.Drawing2D.SmoothingMode.AntiAlias
MyBrush=new TextureBrush(MyImage)
dim MyColor as Color=Color.LightGray
g.FillRectangle(MyBrush,Me.Panel1.ClientRectangle)
for i as Integer=0 To 255-1 step +1
g.FillRectangle(new SolidBrush(Color.FromArgb(i,MyColor)),Me.Panel1.ClientRectangle)
System.Threading.Thread.Sleep(100)
Next
Catch ex as Exception
MessageBox.Show(ex.Message,"信息提示",MessageBoxButton.OK,MessageBoxIcon.Information)
End Try
里面有些大小没区分,写的时候注意吧!不懂可以问我!