成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

vb.net分辨率 vb分辨率適配

在VB.NET中通過那個函數(shù)可以獲取當前屏幕的分辨率?

您可以用下面給出這一小段代碼檢測當前屏幕分辨率,然后根據(jù)結(jié)果作出反應(yīng)──例如,重新調(diào)整窗體大小以適應(yīng)用程序戶分辨率。

創(chuàng)新互聯(lián)專注于企業(yè)成都營銷網(wǎng)站建設(shè)、網(wǎng)站重做改版、米脂網(wǎng)站定制設(shè)計、自適應(yīng)品牌網(wǎng)站建設(shè)、H5網(wǎng)站設(shè)計、商城開發(fā)、集團公司官網(wǎng)建設(shè)、外貿(mào)網(wǎng)站制作、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁設(shè)計等建站業(yè)務(wù),價格優(yōu)惠性價比高,為米脂等各大城市提供網(wǎng)站開發(fā)制作服務(wù)。

Public Function CheckRez(pixelWidth As Long, pixelHeight As Long) As Boolean

'

Dim lngTwipsX As Long

Dim lngTwipsY As Long

'

' convert pixels to twips

lngTwipsX = pixelWidth * 15

lngTwipsY = pixelHeight * 15

'

' check against current settings

If lngTwipsX Screen.Width Then

CheckRez = False

Else

If lngTwipsY Screen.Height Then

CheckRez = False

Else

CheckRez = True

End If

End If

'

End Function

Next, run the following code at the start of the program:

If CheckRez(640, 480) = False Then

MsgBox "Incorrect screen size!"

Else

MsgBox "Screen Resolution Matches!"

End If

VB.NET設(shè)置屏幕分辨率、顏色位數(shù)、刷新率 實例代碼

這篇文章介紹了VB.NET設(shè)置屏幕分辨率、顏色位數(shù)、刷新率

實例代碼,有需要的朋友可以參考一下

復制代碼

代碼如下:

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保存圖片時如何調(diào)整其分辨率

保存前加一句 myImage2.SetResolution(300, 300) 你設(shè)置的bMape不是保存的主畫布 所以無效,設(shè)置分辨率就是 SetResolution(X,Y)

vb.net屏幕分辨率的單位是什么?

默認單位是像素

96是系統(tǒng)的一種設(shè)定,每英寸的點數(shù),是系統(tǒng)界面用小字體時的設(shè)置

用像素數(shù)除以DPI沒有意義

新聞名稱:vb.net分辨率 vb分辨率適配
標題路徑:http://jinyejixie.com/article34/dosedpe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、、關(guān)鍵詞優(yōu)化、網(wǎng)站建設(shè)網(wǎng)站改版、云服務(wù)器

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)頁設(shè)計公司
桑日县| 开远市| 荆门市| 嘉峪关市| 元谋县| 汪清县| 平乐县| 镇赉县| 宁明县| 东兴市| 高雄县| 张掖市| 怀安县| 沙田区| 新宾| 横山县| 新宾| 合水县| 田阳县| 铜陵市| 丹阳市| 东兴市| 库伦旗| 类乌齐县| 六枝特区| 郎溪县| 安平县| 滨州市| 宁晋县| 常熟市| 洛川县| 建瓯市| 江油市| 高雄市| 二连浩特市| 财经| 威宁| 甘孜| 花莲市| 噶尔县| 夏河县|