• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

自我学习之一:淡入淡出(抄)

发布: 2007-7-01 20:40 | 作者: admin | 来源: | 查看: 15次 | 进入软件测试论坛讨论

领测软件测试网

Option Explicit

Public Sub IntervalX(ByVal intI As Integer)
If intI > 0 Then Sleep (intI)  ´制造千分之intI秒的时间间隔
End Sub

Public Sub ShowTransparency(SrcDC As Long, _
                    ByVal SrcX As Long, _
                    ByVal SrcY As Long, _
                    ByVal SrcHeight As Long, _
                    ByVal SrcWidth As Long, _
                    DestDC As Long, _
                    ByVal DestX, _
                    ByVal DestY, _
                    ByVal DestHeight As Long, _
                    ByVal DestWidth As Long, _
                    ByVal nLevel As Byte)
   
    Dim LrProps As rBlendProps
    Dim LnBlendPtr As Long

    LrProps.tBlendAmount = nLevel
    CopyMemory LnBlendPtr, LrProps, 4
    AlphaBlend DestDC, DestX, DestY, DestWidth, DestHeight, _
        SrcDC, SrcX, SrcY, SrcWidth, SrcHeight, LnBlendPtr
End Sub

Public Sub CopyPictureX(ByVal dcSour As Long, _
                        ByVal SourX As Long, _
                        ByVal SourY As Long, _
                        ByVal dcDest As Long, _
                        ByVal DestX As Long, _
                        ByVal DestY As Long, _
                        ByVal DestWidth As Long, _
                        ByVal DestHeight As Long)
´dcSour——>dcDest

    BitBlt dcDest, DestX, DestY, DestWidth, DestHeight, dcSour, SourX, SourY, SRCCOPY

End Sub

Public Sub ScreenCls()

    ´刷新桌面
    InvalidateRectAsAny 0, ByVal 0&, True

End Sub

Private Sub Form_Load()

    Dim i, l, t

    Picture2.Height = Picture1.Height
    Picture2.Width = Picture1.Width

    l = (Screen.Width / Screen.TwipsPerPixelX - Picture1.ScaleWidth) / 2
    t = (Screen.Height / Screen.TwipsPerPixelY - Picture1.ScaleHeight) / 2

    CopyPictureX GetDC(0), l, t, Picture2.hdc, 0, 0, Picture2.ScaleWidth, Picture2.Height

    For i = 0 To 150 Step 7
        IntervalX 150 - i
        DoEvents
        ShowTransparency Picture1.hdc, 0, 0, Picture1.ScaleHeight, _
        Picture1.ScaleWidth, GetDC(0), l, t, _
        Picture1.ScaleHeight, Picture1.ScaleWidth, i
    Next i

    IntervalX 1000
   
    For i = 0 To 150 Step 7
        IntervalX 150 - i
        DoEvents
        ShowTransparency Picture2.hdc, 0, 0, Picture2.ScaleHeight, _
        Picture2.ScaleWidth, GetDC(0), l, t, _
        Picture2.ScaleHeight, Picture2.ScaleWidth, i
    Next i

    ScreenCls

    Unload Me
   
End Sub


文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网