用line,从上向下画线,当然要由浅至深,就是你要的效果了
解决方案 »
- 再次请教,vb写入ini文件,有汉字存在乱码的问题,接上一贴
- 请问!如何用VB编写类似XP登录界面!谢谢!
- setupFactory制作安装包,如何让全屏显示一张图片,还有在安装过程中如何显示图片(是全屏,不要在安装窗口中显示)
- 这样的代码怎样写?
- 如何利用checkbox来控制软件是否自动运行
- 高分求关于系统内码的问题!请帮忙。。。。!!
- 有关操作光盘上的Access数据库问题...
- 请教vb对bmp文件的操作方法
- 连接关闭后,如何保持记录集中的数据?
- 如何修改注册表内的IP?
- 怎样把PICTURE中的图象拷贝到剪贴板?
- 三层结构中如何把客户端picturebox中的图象传给服务器(sqlserver7.0)
Const intBLUEEND% = 0
Const intBANDHEIGHT% = 2
Const intSHADOWSTART% = 8
Const intSHADOWCOLOR% = 0
Const intTEXTSTART% = 4
Const intTEXTCOLOR% = 15
Const intRed% = 1
Const intGreen% = 2
Const intBlue% = 4
Const intBackRed% = 8
Const intBackGreen% = 16
Const intBackBlue% = 32
Dim sngBlueCur As Single
Dim sngBlueStep As Single
Dim intFormHeight As Integer
Dim intFormWidth As Integer
Dim intY As Integer
Dim iColor As Integer
Dim iRed As Single, iBlue As Single, iGreen As Single
'
'Get system values for height and width
'
intFormHeight = ScaleHeight
intFormWidth = ScaleWidth iColor = 3
'Calculate step size and blue start value
'
sngBlueStep = intBANDHEIGHT * (intBLUEEND - intBLUESTART) / intFormHeight
sngBlueCur = intBLUESTART '
'Paint blue screen
'
For intY = 0 To intFormHeight Step intBANDHEIGHT
If iColor And intBlue Then iBlue = sngBlueCur
If iColor And intRed Then iRed = sngBlueCur
If iColor And intGreen Then iGreen = sngBlueCur
If iColor And intBackBlue Then iBlue = 255 - sngBlueCur
If iColor And intBackRed Then iRed = 255 - sngBlueCur
If iColor And intBackGreen Then iGreen = 255 - sngBlueCur
Line (-1, intY - 1)-(intFormWidth, intY + intBANDHEIGHT), RGB(iRed, iGreen, iBlue), BF
sngBlueCur = sngBlueCur + sngBlueStep
Next intY CurrentX = intSHADOWSTART
CurrentY = intSHADOWSTART
ForeColor = QBColor(intSHADOWCOLOR)
CurrentX = intTEXTSTART
CurrentY = intTEXTSTART
ForeColor = QBColor(intTEXTCOLOR)
AutoRedraw =true '否则一擦就没有了
Gradient Me, 130, 256, 50, 0 '使用gradient函数渐变Form
End SubSub Gradient(TheObject As Object, Redval&, Greenval&, Blueval&, TopToBottom As Boolean) 'TheObject 可以是PictureBox图片框或Form表单
'Redval, Greenval, Blueval 是红、绿、蓝三色开始值,从0-255
'TopToBottom 确定画渐变的方向 Dim Step%, Reps%, FillTop%, FillLeft%, FillRight%, FillBottom%, HColor$
Step = (TheObject.Height / 63)
If TopToBottom = True Then FillTop = 0 Else FillTop = TheObject.Height - Step
FillLeft = 0
FillRight = TheObject.Width
FillBottom = FillTop + Step
For Reps = 1 To 63
'画线
TheObject.Line (FillLeft, FillTop)-(FillRight, FillBottom), RGB(Redval, Greenval, Blueval), BF
Redval = Redval - 4
Greenval = Greenval - 4
Blueval = Blueval - 4 If Redval <= 0 Then Redval = 0
If Greenval <= 0 Then Greenval = 0
If Blueval <= 0 Then Blueval = 0
If TopToBottom = True Then FillTop = FillBottom Else FillTop = FillTop - Step
FillBottom = FillTop + Step
Next
End Sub
For i = 0 To Me.ScaleHeight
Line (0, i)-(Me.ScaleWidth, i), RGB(255 - 255 / Me.ScaleHeight * i, 255 - 255 / Me.ScaleHeight * i, 0)
Next
End Sub