游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1942|回复: 1

如何创建一个内存DC :

[复制链接]

88

主题

1125

帖子

1136

积分

金牌会员

Rank: 6Rank: 6

积分
1136
QQ
发表于 2007-7-18 11:50:00 | 显示全部楼层 |阅读模式
说明: 创建以后的DC 必须能执行透明边缘裁减函数的操作 .
方法一:
   Dim hScreenDC   As Long,Dim tBitmap as Bitmap
  
  ' Get the handle to the current display screen's DC
  hScreenDC = GetDC(GetDesktopWindow)
  
  ' Create a compatible DC
  If hScreenDC <> 0 Then MemoryDC_Create = CreateCompatibleDC(hScreenDC)
  
  ' Release the handle to the display screen
  ReleaseDC GetDesktopWindow, hScreenDC
  
       '新建位图
    tBitmap = CreateCompatibleBitmap(hScreenDc, 长, 宽)
    '把新建位图选入DC
    SelectObject m_MemDc, tBitmap

本来大功即将告成.
无奈.在对DC进行边框裁减时出了问题. 请熟悉GDI和FX的朋友帮忙解答.

56

主题

758

帖子

768

积分

高级会员

Rank: 4

积分
768
发表于 2007-7-18 12:23:00 | 显示全部楼层

Re:如何创建一个内存DC :

前面你已经释放DC,后面就不能载入位图了吧?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-25 19:28

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表