您现在的位置是: 软件 > 开发者网络 > 程序方舟 > 开发专栏 > VB开发 > 正文
·速成电脑精英(包分配)白领高薪一族从这里开始



-Java套接字编程(下)
-MediaStudio Pro 6.5教程
-三款卸载软件最新试用
-基于Visual C++的Winsock API研究

API实现完美的图片出现效果
2001-11-24· · ··yesky

上一页  1 2 3 4 5 6 7  下一页

四、逐段翻开效果

  分成几个大块,每个大块分成很多个小块

  如图所示,要将Picture1中的图片拷贝到Picture2中,首先将Picture1从形式上划分为很多宽度为的大块,然后再将每一块进一步划分为宽度为的若干小块。

  然后利用BitBlt函数先将Picture1中的a0块拷贝到Picture2中的相同位置,再拷贝a1块、a2块、…。等待片刻,再拷贝b0块、b1块、b2块、…。如果将取得足够小,则人眼看到 Picture2中的图片就是以逐段翻开的效果出现的。其程序如下:

stripewidth = 40

Stripes = Picture1.ScaleWidth / stripewidth

P2 = Picture1.ScaleHeight

For i = 0 To (Stripes - 1) / 10 Step 1

For m = 0 To stripewidth / 2

r% = BitBlt(Picture2.hDC, P1 + m + stripewidth / 2 + i * stripewidth, 0, 2, P2, Picture1.hDC, P1 + m + stripewidth / 2 + i * stripewidth, 0, &HCC0020)

r% = BitBlt(Picture2.hDC, P1 - m + stripewidth / 2 + i * stripewidth, 0, 2, P2, Picture1.hDC, P1 - m + stripewidth / 2 + i * stripewidth, 0, &HCC0020)

For j = 1 To 10000

Next j

Next m

For j = 1 To 50000

Next j

Next i

上一页  1 2 3 4 5 6 7  下一页

■ 相关内容
 用Visual Basic设计Windows门禁程序
 VB6中用DataReport做报表
 SENDMESSAGE函数巧应用
 VB中访问API函数之防错技巧
 半透明窗体(win2000特有API)
 采用API实现的文件拖放
感谢 访问天极网,如果您觉得该文章涉及版权问题,请看这里!