Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a question about resalution and hardware 1

Status
Not open for further replies.

Toastie

Programmer
May 19, 2001
123
AU
If i was to use the following code would i have any problems with certain video cards? Because i am a newbie i dont know too much about anything but certain people told me that some display cards show 12 twips per pixel and soem 15 twips per pixel.

well this is what i have got in the way of code

Public Sub CheckRes()
Dim X As Long, Y As Long
Dim MsgTitle As String
Dim MsgStyle As Long
Dim Msg As String
Dim MsgResponse As Long

Y = GetSystemMetrics(0)
X = GetSystemMetrics(1)


If X = 600 And Y = 800 Then
cmdFullScreen_Click
ElseIf X = 480 And Y = 640 Then
cmdFullScreen_Click_B
ElseIf X = 768 And Y = 1024 Then
cmdFullScreen_Click_C
Else
MsgTitle = "Invalid Resolution"
MsgStyle = vbCritical
Msg = "You are unable to view fullscreen mode because" & vbCrLf
Msg = Msg & "your current video resolution is: " & Y & " X " & X & vbCrLf
Msg = Msg & "It is recomended that resolution is set at 800 X 600."
MsgResponse = MsgBox(Msg, MsgStyle, MsgTitle)

End If
End Sub

Private Sub cmdFullScreen_Click_B()
Dim Jim As Long
Jim = SetWindowRgn(Me.hwnd, 0, False)
ShapedForm.WindowState = 2

WebBrowser1.Width = 9600
WebBrowser1.Height = 7200
WebBrowser1.Top = 0
WebBrowser1.Left = 0

Form1.Show

Timer1.Enabled = True
End Sub
Private Sub cmdFullScreen_Click_C()
Dim Jim As Long
Jim = SetWindowRgn(Me.hwnd, 0, False)
ShapedForm.WindowState = 2

WebBrowser1.Width = 15360
WebBrowser1.Height = 11520
WebBrowser1.Top = 0
WebBrowser1.Left = 0

Form1.Show

Timer1.Enabled = True
End Sub
Private Sub cmdFullScreen_Click()


Dim Jim As Long
Jim = SetWindowRgn(Me.hwnd, 0, False)
ShapedForm.WindowState = 2
WebBrowser1.Width = 12000
WebBrowser1.Height = 9000
WebBrowser1.Top = 0
WebBrowser1.Left = 0

Form1.Show

Timer1.Enabled = True
End Sub

if anyone knows anything about any of this please reply.

thanks

Toastie
 
You can determine what the twips setting is via:

Xpixel=Screen.TwipsPerPixelX

and

Ypixel=Screen.TwipsPerPixelY

Thus, the various sizes for your browser could be set as follows:

WebBrowser1.Width = DesiredWidthInPixels * Xpixel
WebBrowser1.Height = DesiredHeightinPixels * Ypixel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top