Beautify your text

zhaozj2021-02-11  186

Do you want to play some characteristics of the character? Very simple, you don't need to calculate what pixel values ​​such as width 1, just call an API function, you can get it! She is -setTextCharacterextra () The function of this function is to change the interval size of each character in the string. Want to open the API Viewer? And slow! There is a problem with this function in the API Viewer! ! ! How do you do it? I don't know, I will ask. API Viewer statement: Private Declare Function SetTextCharacterExtra Lib "gdi32" Alias ​​"SetTextCharacterExtraA" (ByVal hdc As Long, ByVal nCharExtra As Long) As Long should be: Private Declare Function SetTextCharacterExtra Lib "gdi32" (ByVal hdc As Long, ByVal nCharExtra As LONG) As long: API Viewer adds more in GDI32.DLL ("setTextCharacterextraa), don't believe you try, say" The entry function can not be found. " Ok, I know the problem is good, you need to prepare a Picturebox first, we use its HDC. Private I as long () Timer1_timer () Timer1.Interval = 100 with Picture1 .cls setTextcharacterextra .hdc, i picture1.print "midnight" i = i 1 if i> = 30 Then i = 1 end with end SUB of course, I This is Timer, if you think that the CPU usage is too high, you will change it yourself. For example, add the Timer value of the system clock in a loop to control the interval. Finally, beautify your Picturebox, change a good-looking font, awake color, even change the color and font size in the loop, make it left and right with the step value, how to change it! how about it? This Dongdong adds to your About form, must be very good. I guarantee that the speed and resource consumption are better than the method of controlling pixel decline. Ok, I will say this now, I will go!

转载请注明原文地址:https://www.9cbs.com/read-5871.html

New Post(0)