VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "clsDisplayMode" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = False Option Explicit Public Enum enDisplayOrientation doDefault = 0 do90 = 1 do180 = 2 do270 = 3 End Enum Public Enum enDisplayFixedOutput dfoDefault = 0 dfoStretch = 1 dfoCenter = 2 End Enum Private m_Width As Long Private m_Height As Long Private m_Depth As Byte Private m_Frequency As Integer Private m_DisplayOrientation As enDisplayOrientation Private m_DisplayFixedOutput As enDisplayFixedOutput Public Property Get Width() As Long Width = m_Width End Property Public Property Let Width(ByVal inNew As Long) m_Width = inNew End Property Public Property Get Height() As Long Height = m_Height End Property Public Property Let Height(ByVal inNew As Long) m_Height = inNew End Property Public Property Get Depth() As Byte Depth = m_Depth End Property Public Property Let Depth(ByVal inNew As Byte) m_Depth = inNew End Property Public Property Get Frequency() As Integer Frequency = m_Frequency End Property Public Property Let Frequency(ByVal inNew As Integer) m_Frequency = inNew End Property Public Property Get DisplayOrientation() As enDisplayOrientation DisplayOrientation = m_DisplayOrientation End Property Public Property Let DisplayOrientation(ByVal inNew As enDisplayOrientation) m_DisplayOrientation = inNew End Property Public Property Get DisplayFixedOutput() As enDisplayFixedOutput DisplayFixedOutput = m_DisplayFixedOutput End Property Public Property Let DisplayFixedOutput(ByVal inNew As enDisplayFixedOutput) m_DisplayFixedOutput = inNew End Property Public Sub Create(ByVal inWidth As Long, ByVal inHeight As Long, _ ByVal inDepth As Byte, ByVal inFrequency As Integer, _ Optional ByVal inDisplayOrientation As enDisplayOrientation = doDefault, _ Optional ByVal inDisplayFixedOutput As enDisplayFixedOutput = dfoDefault) m_Width = inWidth ' Object constructor m_Height = inHeight m_Depth = inDepth m_Frequency = inFrequency m_DisplayOrientation = inDisplayOrientation m_DisplayFixedOutput = inDisplayFixedOutput End Sub Public Function IsValid() As Boolean ' Check whether this looks like a valid display mode IsValid = ((m_Width > 0) And (m_Height > 0) And (m_Depth > 0) And (m_Frequency > 0)) End Function Public Function SameMode(ByRef inMode As clsDisplayMode) As Boolean If (inMode Is Nothing) Then Exit Function With inMode ' Check to see if the properties of these modes are equal SameMode = ((.Width = m_Width) And (.Height = m_Height) And _ (.Depth = m_Depth) And (.Frequency = m_Frequency) And _ (.DisplayOrientation = m_DisplayOrientation) And _ (.DisplayFixedOutput = m_DisplayFixedOutput)) End With End Function Public Function ToString() As String ToString = m_Width & " * " & m_Height & " * " & m_Depth & " (" & m_Frequency & " Htz)" If (m_DisplayOrientation) Then ToString = ToString & " " & _ CStr(m_DisplayOrientation * 90) & Chr$(&HB0) If (m_DisplayFixedOutput) Then ToString = ToString & ", " & _ Choose(m_DisplayFixedOutput, "Stretch", "Center") & " fixed output" End Function