watt Posted July 24, 2006 at 02:01 PM Report #39944 Posted July 24, 2006 at 02:01 PM Boas! já tenho o codigo para retirar a resolução grafica do meu monitor Dim Screens() As System.Windows.Forms.Screen = System.Windows.Forms.Screen.AllScreens Dim oscreen As System.Windows.Forms.Screen = Screens(0) MsgBox(oscreen.Bounds.Height.ToString & " " & oscreen.Bounds.Width.ToString) Agora queria saber como faço para esta reoluções ser alteradas?
SoulOnFire Posted July 24, 2006 at 03:11 PM Report #39966 Posted July 24, 2006 at 03:11 PM Boas Fika aki uma class que fiz para isso, espero k te resolva o problema s n der ja sabes 😁 Fika bem!! Imports System Imports System.Windows.Forms Imports System.Runtime.InteropServices Class Ecra #Region "Região de utilização de USER32.DLL" Private Declare Auto Function EnumDisplaySettings Lib "user32.dll" ( _ <MarshalAs(UnmanagedType.LPTStr)> ByVal lpszDeviceName As String, _ ByVal iModeNum As Int32, _ ByRef lpDevMode As DEVMODE _ ) As Boolean Private Declare Auto Function ChangeDisplaySettings Lib "user32.dll" ( _ ByRef lpDevMode As DEVMODE, _ ByVal dwFlags As Int32 _ ) As Int32 Private Const DM_BITSPERPEL As Int32 = &H40000 Private Const DM_PELSWIDTH As Int32 = &H80000 Private Const DM_PELSHEIGHT As Int32 = &H100000 Private Const DISP_CHANGE_SUCCESSFUL As Int32 = 0 <StructLayout(LayoutKind.Sequential)> _ Private Structure POINTL Public x As Int32 Public y As Int32 End Structure <StructLayout(LayoutKind.Explicit)> _ Private Structure DEVMODE_union1 ' struct { <FieldOffset(0)> Public dmOrientation As Int16 <FieldOffset(2)> Public dmPaperSize As Int16 <FieldOffset(4)> Public dmPaperLength As Int16 <FieldOffset(6)> Public dmPaperWidth As Int16 ' } <FieldOffset(0)> Public dmPosition As POINTL End Structure <StructLayout(LayoutKind.Explicit)> _ Private Structure DEVMODE_union2 <FieldOffset(0)> Public dmDisplayFlags As Int32 <FieldOffset(0)> Public dmNup As Int32 End Structure <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _ Private Structure DEVMODE Private Const CCDEVICENAME As Int32 = 32 Private Const CCFORMNAME As Int32 = 32 <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=CCDEVICENAME)> _ Public dmDeviceName As String Public dmSpecVersion As Int16 Public dmDriverVersion As Int16 Public dmSize As Int16 Public dmDriverExtra As Int16 Public dmFields As Int32 Public u1 As DEVMODE_union1 Public dmScale As Int16 Public dmCopies As Int16 Public dmDefaultSource As Int16 Public dmPrintQuality As Int16 Public dmColor As Int16 Public dmDuplex As Int16 Public dmYResolution As Int16 Public dmTTOption As Int16 Public dmCollate As Int16 <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=CCFORMNAME)> _ Public dmFormName As String Public dmUnusedPadding As Int16 Public dmBitsPerPel As Int16 Public dmPelsWidth As Int32 Public dmPelsHeight As Int32 Public u2 As DEVMODE_union2 Public dmDisplayFrequency As Int32 Public dmICMMethod As Int32 Public dmICMIntent As Int32 Public dmMediaType As Int32 Public dmDitherType As Int32 Public dmReserved1 As Int32 Public dmReserved2 As Int32 Public dmPanningWidth As Int32 Public dmPanningHeight As Int32 End Structure #End Region #Region "Metodo de Mudar o Ecra" ''' <summary> ''' Função que Premite alterar a resolução do ecra ''' </summary> ''' <param name="Width">Largura em pixeis</param> ''' <param name="Height">Altura em pixeis</param> ''' <param name="BitsPerPixel">Bits por Pixel</param> ''' <returns>Retorna se foi possivel ou não</returns> ''' <remarks>Realizado por Miguel Duarte</remarks> Public Function SetResolution( _ ByVal Width As Int32, _ ByVal Height As Int32, _ ByVal BitsPerPixel As Int16 _ ) As Boolean Dim dm As DEVMODE If Not EnumDisplaySettings(Nothing, 0, dm) Then Return False Else With dm .dmFields = _ DM_PELSWIDTH Or DM_PELSHEIGHT Or DM_BITSPERPEL .dmPelsWidth = Width .dmPelsHeight = Height .dmBitsPerPel = BitsPerPixel End With Return (ChangeDisplaySettings(dm, 0) = DISP_CHANGE_SUCCESSFUL) End If End Function #End Region End Class [edit] para usar basta Dim sr As New Ecra sr.SetResolution(1024, 768, 32) [/edit] Fikem Bem!!!Miguel Duarte - (SoulOnFire)O meu BLOG - XAML E WPF - http://wpfpt.wordpress.com/
vbmaster Posted July 24, 2006 at 07:14 PM Report #40033 Posted July 24, 2006 at 07:14 PM A tag é [vb.net 2005] e não[ ajuda]!
watt Posted July 24, 2006 at 10:34 PM Author Report #40064 Posted July 24, 2006 at 10:34 PM ups sorry
watt Posted July 25, 2006 at 06:37 PM Author Report #40242 Posted July 25, 2006 at 06:37 PM como é que faço para aumentar tambem o formulario ?? tentei fazer Me.Size = New Size(1024, 768) mas não dá o monitor muda de resolução.
Asgorath Posted July 26, 2006 at 09:25 AM Report #40326 Posted July 26, 2006 at 09:25 AM Me.ClientSize = New System.Drawing.Size(992, 656) Me.Size = New System.Drawing.Size(992, 656) Jorge "The Dark Side Clouds Everthing. Impossible To See The Future Is."My rig: Intel Core 2 Quad Q9450 | abit IP35P | 4G Kingston 800 Mhz | XFX GeForce 9800 GX2 1G ddr3 | 2X WD5000AAJS 500Gb Sata 2 | PSU 600W || Caixa El-Diablo | Creative XMod
watt Posted July 26, 2006 at 09:45 PM Author Report #40482 Posted July 26, 2006 at 09:45 PM a janela não me maximiza 👍
SoulOnFire Posted July 27, 2006 at 09:06 AM Report #40511 Posted July 27, 2006 at 09:06 AM a janela não me maximiza 👍 Mas afinal tu keres mudar o tamanho da janela ou apenas maximiza-la??? porque se é para maximizar basta fazeres isto me.WindowState=FormWindowState.Maximized deve funcionar!!! Fikem Bem!!!Miguel Duarte - (SoulOnFire)O meu BLOG - XAML E WPF - http://wpfpt.wordpress.com/
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now