In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you how to use VB to achieve blinds graphics special effects, I believe that most people do not know much, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to know it!
In software like Powerpoint, a variety of graphic special effects emerge one after another, among which the switching effect of "blinds" is particularly novel and strange. It is very simple and convenient to realize such graphic special effects in VB. The way to do this is to call WINDOWS's API function Bitblt. BitBlt function is similar to the combined use of getimage and putimage functions in C language. BitBlt originally means "Bit Block Transfer", and its main purpose is to copy bitmaps. Use BitBlt function to show graphics special effects, the principle is very simple, the production of first in the form to draw two picture frames, the picture into a picture frame, while the other picture frame is set to empty, and then call the BitBlt function to copy part of the first picture frame graphics to the second picture frame, so you can achieve strange graphics special effects.
Create a new form in the VB environment, draw two picture boxes picSour and picDest, and two command buttons cmdShow and cmdExit. First of all, declare the BitBlt function as the required constant name in the general process of the form, load the picture in the picSour while loading the form, and call the BitBlt function in the event of the button cmdShow. The procedure is as follows:
The API function declaration:
Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer,ByVal X As Integer,ByVal Y As Integer,ByVal nWidth AS Integer,ByVal nHeight As Integer,ByVal hSrcDC As Integer,ByVal xSrc As Integer,ByVal ySrc As Integer,ByVal dwRop As Long) As Integer
One of the 15 algorithms of Const COPY-PUT=&HCC0020'BitBlt, which represents direct copy
Load pictures:
Sub Form-Load ()
Picsour.Picture=LoadPicture ("c:\ windows\ LEAVES.bmp")
Picsour.ScaleMode=3' is in pixels
End Sub
Displays the switching effect of the blinds:
Sub Comshow-Click ()
H%=picsour.ScaleHeight
W%=picsour.ScaleWidth
Scanlines=4
For iTun0 To (scanlines-1)
For junii To H% Step scanlines
S% percentage BitBlt% (picdest.hDC,0,j,W%,1,picsour.hDC,0,j,copy-Put)
Delay 500' delay
Next j
Next i
End Sub
Among them, delay is a general subprocess, which is used to delay time so that the switching effect can be seen clearly. The code is as follows:
Sub delay (delaytime As Integer)
For iTunes 1 To delaytime
Next i
End Sub
Through such a simple program can achieve "blinds" switch special effects, in fact, as long as there is a suitable algorithm, the use of BitBlt function can achieve graphic special effects is endless.
The above is all the contents of the article "how to use VB to achieve the graphic special effects of blinds". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.