资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

Vb.net像素深度的简单介绍

vb.net如何获取屏幕分辨率从而设置窗体大小

默认单位是像素

专注于为中小企业提供成都做网站、网站制作服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业蜀山免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了上1000家企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。

96是系统的一种设定,每英寸的点数,是系统界面用小字体时的设置

用像素数除以dpi没有意义

vb.net保存图片时如何调整其分辨率

保存前加一句 myImage2.SetResolution(300, 300) 你设置的bMape不是保存的主画布 所以无效,设置分辨率就是 SetResolution(X,Y)

VB.NET设置屏幕分辨率、颜色位数、刷新率 实例代码

这篇文章介绍了VB.NET设置屏幕分辨率、颜色位数、刷新率

实例代码,有需要的朋友可以参考一下

复制代码

代码如下:

Private

Declare

Function

GetDeviceCaps

Lib

"gdi32"

(ByVal

hdc

As

Long,

ByVal

nIndex

As

Long)

As

Long

Private

Declare

Function

ChangeDisplaySettings

Lib

"user32"

Alias

"ChangeDisplaySettingsA"

(lpDevMode

As

Any,

ByVal

dwflags

As

Long)

As

Long

Private

Const

CCDEVICENAME

As

Long

=

32

Private

Const

CCFORMNAME

As

Long

=

32

Private

Const

DM_BITSPERPEL

As

Long

=

H40000

Private

Const

DM_PELSWIDTH

As

Long

=

H80000

Private

Const

DM_PELSHEIGHT

As

Long

=

H100000

Private

Const

DM_DISPLAYFLAGS

As

Long

=

H200000

Private

Const

DM_DISPLAYFREQUENCY

=

H400000

Private

Const

CDS_FORCE

As

Long

=

H80000000

Private

Const

BITSPIXEL

As

Long

=

12

Private

Const

HORZRES

As

Long

=

8

Private

Const

VERTRES

As

Long

=

10

Private

Const

VREFRESH

=

116

Private

Type

DEVMODE

dmDeviceName

As

String

*

CCDEVICENAME

dmSpecVersion

As

Integer

dmDriverVersion

As

Integer

dmSize

As

Integer

dmDriverExtra

As

Integer

dmFields

As

Long

dmOrientation

As

Integer

dmPaperSize

As

Integer

dmPaperLength

As

Integer

dmPaperWidth

As

Integer

dmScale

As

Integer

dmCopies

As

Integer

dmDefaultSource

As

Integer

dmPrintQuality

As

Integer

dmColor

As

Integer

dmDuplex

As

Integer

dmYResolution

As

Integer

dmTTOption

As

Integer

dmCollate

As

Integer

dmFormName

As

String

*

CCFORMNAME

dmUnusedPadding

As

Integer

dmBitsPerPel

As

Integer

dmPelsWidth

As

Long

dmPelsHeight

As

Long

dmDisplayFlags

As

Long

dmDisplayFrequency

As

Long

End

Type

Private

Sub

cmdChangeDesktopMode_Click()

Dim

DM

As

DEVMODE

With

DM

.dmPelsWidth

=

CInt(txtNewWidth.Text)

.dmPelsHeight

=

CInt(txtNewHeight.Text)

.dmBitsPerPel

=

CInt(txtNewColor.Text)

.dmDisplayFrequency

=

CInt(txtNewFreq.Text)

.dmFields

=

DM_PELSWIDTH

Or

DM_PELSHEIGHT

Or

DM_BITSPERPEL

Or

DM_DISPLAYFREQUENCY

.dmSize

=

LenB(DM)

End

With

If

ChangeDisplaySettings(DM,

CDS_FORCE)

Then

MsgBox

"错误!不支持此模式!"

End

If

End

Sub

Private

Sub

Form_Load()

txtOldWidth.Text

=

GetDeviceCaps(Me.hdc,

HORZRES)

txtOldHeight.Text

=

GetDeviceCaps(Me.hdc,

VERTRES)

txtOldColor.Text

=

GetDeviceCaps(Me.hdc,

BITSPIXEL)

txtOldFreq.Text

=

GetDeviceCaps(Me.hdc,

VREFRESH)

End

Sub

在vb.net中,如何获取Graphics中某一指定点(像素)的颜色值?(VB语言)

要使用GetPixel函数来取得像素的颜色值,代码如下:

1

2

3

4

5

private void button1_Click(object sender, EventArgs e)

{

Color color = new Bitmap(pictureBox1.Image).GetPixel(10, 10);

MessageBox.Show(color.ToString());


本文题目:Vb.net像素深度的简单介绍
当前URL:http://cdkjz.cn/article/hehgdo.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220