vbAccelerator - Contents of code file: cEyes.cls
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "cEyes"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Private m_cMemDC As New pcMemDC
Private m_sFileName As String
Private m_lFrame As Long
Public Property Get Frame() As Long
Frame = m_lFrame
End Property
Public Property Let Frame(ByVal lFrame As Long)
m_lFrame = lFrame
End Property
Public Property Let FileName(ByVal value As String)
m_sFileName = value
m_cMemDC.CreateFromPicture LoadPicture(m_sFileName)
End Property
Public Property Get FileName() As String
FileName = m_sFileName
End Property
Public Property Get CellWidth() As Long
CellWidth = m_cMemDC.Width \ 9
End Property
Public Property Get CellHeight() As Long
CellHeight = m_cMemDC.Height \ 4
End Property
Public Sub Draw(ByVal lhDC As Long, ByVal lLeft As Long, ByVal lTop As Long)
Dim lSrcLeft As Long
Dim lSrcTop As Long
lSrcLeft = (m_lFrame Mod 9) * CellWidth
lSrcTop = (m_lFrame \ 9) * CellHeight
m_cMemDC.Draw lhDC, lSrcLeft, lSrcTop, CellWidth, CellHeight, lLeft, lTop
End Sub
|
|