查看单个帖子
旧 2009-05-06, 02:31 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】how to draw directly on bitmap

how to draw directly on bitmap?
how to draw directly on bitmap?
dear all!
do anyone know how to put hdc of bitmap (example: gdiplus::bitmap) and force dwgdirect draw directly on this bitmap?
we can put properties with hwnd and hdc:
quote:
if(pproperties->has(dd_t("windowhwnd"))) // check if property is supported
pproperties->putat(dd_t("windowhwnd"), odrxvariantvalue((long)m_hwnd)); // hwnd necessary for directx device
if(pproperties->has(dd_t("windowhdc"))) // check if property is supported
pproperties->putat(dd_t("windowhdc"), odrxvariantvalue((long)m_hwindowdc)); // hwindowdc necessary for bitmap device
but bitmap has no hwnd, only hdc. i put hdc of bitmap in properties but nothing draw on this bitmap.
how to put the properties and get the bitmap?
i really really need this, please help...!
thank you very much!
trang

you can use bitmap device (see bmpout example in excustobjs). it no need hdc or hwnd properties input and draws into offscreen raster image. after vectorizing you can get this raster image and blit onto your hdc as you want.
devices source code is available for download, so you can modify any device manually for your needs.
additionally:
only windirectx device use hwnd peoperty (it need for directx device creation). wingdi and opengl devices use only hdc property.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)