一个字形窗体制作中SelectObject的使用问题,希望有人能解释哈VB codePrivate Sub Form_Load()Dim dc As Lo
一个字形窗体制作中SelectObject的使用问题,希望有人能解释哈
VB code
Private Sub Form_Load() Dim dc As Long Dim m_wndRgn As Long Dim m_Font As Long Dim m_OldFont As Long dc = Me.hdc m_Font = CreateFont(200, 90, 0, 0, FW_HEAVY, 1, 0, _ 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, _ CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, _ DEFAULT_PITCH Or FF_SWISS, "宋体") BeginPath dc '开始记录窗体轮廓路径 SetBkMode dc, TRANSPARENT '设置背景为透明模式,这是必须有的 fg = SelectObject(dc, m_Font) TextOut dc, 0, 0, "VB6", 3 SelectObject dc, m_OldFont EndPath dc '结束记录窗体轮廓路径 m_wndRgn = PathToRegion(dc) '把所记录的路径转化为窗体轮廓句柄 SetWindowRgn Me.hWnd, m_wndRgn, True '赋予窗体指定的轮廓形状End Sub