打印本文 打印本文 关闭窗口 关闭窗口
VB打造超酷个性化菜单(三)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数9898  更新时间:2009/4/23 15:44:34  文章录入:mintao  责任编辑:mintao
)

                                GreenArea = (Int(FillEndColor / &H100) And &HFF) - (Int(FillStartColor / &H100) And &HFF)

                                RedArea = (FillEndColor And &HFF) - (FillStartColor And &HFF)

           

                                For i = itemRect.Left To itemRect.Right - 1

                                    red = Int(FillStartColor And &HFF) + Int((i - itemRect.Left) / (itemRect.Right - itemRect.Left + 1) * RedArea)

                                    green = (Int(FillStartColor / &H100) And &HFF) + Int((i - itemRect.Left) / (itemRect.Right - itemRect.Left + 1) * GreenArea)

                                    blue = Int(FillStartColor / &H10000) + Int((i - itemRect.Left) / (itemRect.Right - itemRect.Left + 1) * BlueArea)

                                    hPen = CreatePen(PS_SOLID, 1, RGB(red, green, blue))

                                    Call SelectObject(.hdc, hPen)

                                    Call MoveToEx(.hdc, i, itemRect.Top, 0)

                                    Call LineTo(.hdc, i, itemRect.Bottom)

                                    Call DeleteObject(hPen)

                                Next i

                               

                            Case ISFS_VERTICALCOLOR                         '''' 垂直渐变色

                               

                                BlueArea = Int(FillEndColor / &H10000) - Int(FillStartColor / &H10000)

                                GreenArea = (Int(FillEndColor / &H100) And &HFF) - (Int(FillStartColor / &H100) And &HFF)

                                RedArea = (FillEndColor And &HFF) - (FillStartColor And &HFF)

                               

                                For i = itemRect.Top To itemRect.Bottom - 1

                                    red = Int(FillStartColor And &HFF) + Int((i - itemRect.Top) / (itemRect.Bottom - itemRect.Top + 1) * RedArea)

                                    green = (Int(FillStartColor / &H100) And &HFF) + Int((i - itemRect.Top) / (itemRect.Bottom - itemRect.Top + 1) * GreenArea)

                                    blue = Int(FillStartColor / &H10000) + Int((i - itemRect.Top) / (itemRect.Bottom - itemRect.Top + 1) * BlueArea)

                                    hPen = CreatePen(PS_SOLID, 1, RGB(red, green, blue))

                                    Call SelectObject(.hdc, hPen)

                                    Call MoveToEx(.hdc, itemRect.Left, i, 0)

                                    Call LineTo(.hdc, itemRect.Right, i)

                                    Call DeleteObject(hPen)

 << 上一页  [11] [12] [13] [14] [15] [16]  下一页

打印本文 打印本文 关闭窗口 关闭窗口