VB获取颜色色深位数

来源:互联网 发布:淘宝暴利产品有哪些 编辑:程序博客网 时间:2024/05/01 09:57
  • VB获取颜色色深是多少位,一般XP系统是16位和32位,vista和Windows7没注意,若需要此方面的技巧,可参考下本代码:

    VERSION 5.00Begin VB.Form Form1    BorderStyle     =   1  'Fixed Single   Caption         =   "获取当前显示器颜色值"   ClientHeight    =   1125   ClientLeft      =   1125   ClientTop       =   1500   ClientWidth     =   3270   Icon            =   "Form1.frx":0000   LinkTopic       =   "Form1"   MaxButton       =   0   'False   PaletteMode     =   1  'UseZOrder   ScaleHeight     =   1125   ScaleWidth      =   3270   StartUpPosition =   2  '屏幕中心EndAttribute VB_Name = "Form1"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long) As LongPrivate Const BITSPIXEL As Long = 12Private Sub Form_Load()        MsgBox "当前显示器颜色质量" & GetDeviceCaps(hDC, BITSPIXEL) & " 位"End Sub

0 0
原创粉丝点击