查看运行效果引用DSAPI.DLL 把上面两个图片放到工程资源,添加Timer控件Public Class Form1 Private 背景 As Bitmap = Nothing Private 播放帧 As Integer = 0 Private 向后播放 As Boolean = True Private 停止播放 As Boolean = False Private 背景大小 As Size Private 文字层 As New DSAPI.图形图像.彩色文字图像 Private 进度值 As Integer = 0 Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing 停止播放 = True End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None Me.DoubleBuffered = True 背景大小 = My.Resources.V.Size Me.Size = My.Resources.V.Size DSAPI.图形图像.透明窗体.显示图像(Me, My.Resources.V, 255) DSAPI.图形图像.透明窗体.窗体支持鼠标拖动(Me, True) '--初始化文字渲染引擎 With 文字层 .画布尺寸 = 背景大小 .字体 = New Font("微软雅黑", 18) .绘制描边 = True .描边颜色 = Color.Black .绘制阴影 = True .阴影颜色 = Color.Black .文字清晰度 = Drawing.Text.TextRenderingHint.AntiAlias .文字颜色 = Color.White End With CheckForIllegalCrossThreadCalls = False Dim T As New Threading.Thread(AddressOf 播放动画) T.Start() End Sub Private Sub 播放动画() Try While 停止播放 = False If 向后播放 Then 播放帧 += 2 If 播放帧 > 60 Then 向后播放 = False End If Else 播放帧 -= 2 If 播放帧 < 0 Then 向后播放 = True End If End If 创建背景() Threading.Thread.Sleep(30) End While Catch End Try End Sub Private Sub 创建背景() Try 背景 = Nothing 背景 = New Bitmap(背景大小.Width, 背景大小.Height) Using G As Graphics = Graphics.FromImage(背景) '---绘制光线层 Dim Rct As Rectangle = New Rectangle(播放帧, 播放帧, 背景大小.Width - 播放帧 * 2, 背景大小.Height - 播放帧 * 2) G.DrawImage(My.Resources._1, Rct, New Rectangle(0, 0, 背景大小.Width, 背景大小.Height), GraphicsUnit.Pixel) '---绘制前景层 G.DrawImage(My.Resources.V, New Rectangle(0, 0, 背景大小.Width, 背景大小.Height), New Rectangle(0, 0, 背景大小.Width, 背景大小.Height), GraphicsUnit.Pixel) '---绘制文字层 Try Dim Img As Bitmap = 文字层.输出图像 If Img IsNot Nothing Then G.DrawImage(Img, New Rectangle(Me.Width / 3, Me.Height - 100, Img.Width, Img.Height), New Rectangle(0, 0, Img.Width, Img.Height), GraphicsUnit.Pixel) End If Catch End Try End Using DSAPI.图形图像.透明窗体.显示图像(Me, 背景, 255) Catch End Try End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick 进度值 += 1 If 进度值 > 100 Then 进度值 = 0 文字层.代码文本 = "<color=255,255,255>载入进度:</color><color=100,255,0><b>" & 进度值 & "%</b></color>" End Sub End Class
就是贴个图片,画个进度条
擦,你的还有这功能?不会就是设置窗体Region的吧。还是用了那个SetWindowLayer的?
半透什么的 winfrom还是能实现的
擦,你的还有这功能?不会就是设置窗体Region的吧。还是用了那个SetWindowLayer的?好东西给了你你也不知道呀.只要一句代码
DSAPI.图形图像.透明窗体.显示图像(this,PNG图片,透明度0-255)
如果要拖动就
DSAPI.图形图像.透明窗体.窗体支持鼠标拖动(this,true)
查看运行效果引用DSAPI.DLL
把上面两个图片放到工程资源,添加Timer控件Public Class Form1
Private 背景 As Bitmap = Nothing
Private 播放帧 As Integer = 0
Private 向后播放 As Boolean = True
Private 停止播放 As Boolean = False
Private 背景大小 As Size
Private 文字层 As New DSAPI.图形图像.彩色文字图像
Private 进度值 As Integer = 0
Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
停止播放 = True
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.DoubleBuffered = True
背景大小 = My.Resources.V.Size
Me.Size = My.Resources.V.Size
DSAPI.图形图像.透明窗体.显示图像(Me, My.Resources.V, 255)
DSAPI.图形图像.透明窗体.窗体支持鼠标拖动(Me, True)
'--初始化文字渲染引擎
With 文字层
.画布尺寸 = 背景大小
.字体 = New Font("微软雅黑", 18)
.绘制描边 = True
.描边颜色 = Color.Black
.绘制阴影 = True
.阴影颜色 = Color.Black
.文字清晰度 = Drawing.Text.TextRenderingHint.AntiAlias
.文字颜色 = Color.White
End With
CheckForIllegalCrossThreadCalls = False
Dim T As New Threading.Thread(AddressOf 播放动画)
T.Start()
End Sub
Private Sub 播放动画()
Try
While 停止播放 = False
If 向后播放 Then
播放帧 += 2
If 播放帧 > 60 Then
向后播放 = False
End If
Else
播放帧 -= 2
If 播放帧 < 0 Then
向后播放 = True
End If
End If
创建背景()
Threading.Thread.Sleep(30)
End While
Catch
End Try
End Sub
Private Sub 创建背景()
Try
背景 = Nothing
背景 = New Bitmap(背景大小.Width, 背景大小.Height)
Using G As Graphics = Graphics.FromImage(背景)
'---绘制光线层
Dim Rct As Rectangle = New Rectangle(播放帧, 播放帧, 背景大小.Width - 播放帧 * 2, 背景大小.Height - 播放帧 * 2)
G.DrawImage(My.Resources._1, Rct, New Rectangle(0, 0, 背景大小.Width, 背景大小.Height), GraphicsUnit.Pixel)
'---绘制前景层
G.DrawImage(My.Resources.V, New Rectangle(0, 0, 背景大小.Width, 背景大小.Height), New Rectangle(0, 0, 背景大小.Width, 背景大小.Height), GraphicsUnit.Pixel)
'---绘制文字层
Try
Dim Img As Bitmap = 文字层.输出图像
If Img IsNot Nothing Then
G.DrawImage(Img, New Rectangle(Me.Width / 3, Me.Height - 100, Img.Width, Img.Height), New Rectangle(0, 0, Img.Width, Img.Height), GraphicsUnit.Pixel)
End If
Catch
End Try
End Using
DSAPI.图形图像.透明窗体.显示图像(Me, 背景, 255)
Catch
End Try
End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
进度值 += 1
If 进度值 > 100 Then 进度值 = 0
文字层.代码文本 = "<color=255,255,255>载入进度:</color><color=100,255,0><b>" & 进度值 & "%</b></color>"
End Sub
End Class
参数:要显示图像的窗体,要显示的图片,透明度(0-255)
这句将输出画面到屏幕上,当然在这句面前也可以使用一些其他效果.比如: DSAPI.图形图像.图像特效.色彩.反色(背景)
DSAPI.图形图像.图像特效.色彩.保留通道(背景, DSAPI.图形图像.图像特效.色彩.色彩通道.绿)
DSAPI.图形图像.图像特效.色彩.灰度(背景)
DSAPI.图形图像.图像特效.色彩.投影效果(背景, 10) DSAPI.图形图像.透明窗体.显示图像(Me, 背景, 255)