阅读:1372回复:3
哪位能解释一下三种类型的绘制表面(surface)吗?
昨天在snowStart的指点下总算清楚了三种类型的打印驱动.不过现在又被三种绘画表面类型给难住了.
1. 引擎管理的表面 2. 设备管理的表面(标准格式位图) 3. 设备管理的表面(非标准表面) 我的认为: 我要生成矢量的AutoCAD格式文件(AutoCAD文件是文本方式存储的),用哪咱表面好像都没有太大关系.我只是把每个图形绘画的调用转换为相应的字符到一文本文件中就可以 了, 不知道我的理解对不对,所以还希望有高手指点一下. |
|
|
沙发#
发布于:2005-03-10 18:02
我想也是这样子
|
|
|
板凳#
发布于:2005-03-11 08:45
我想也是这样子 那绘制表面的作用在哪里呀?这样的话,在开发打印机驱动时完全可以忽略绘制表面的存在了,都按GDI管理不是更好理解??? |
|
|
地板#
发布于:2005-03-11 12:38
[quote]我想也是这样子 那绘制表面的作用在哪里呀?这样的话,在开发打印机驱动时完全可以忽略绘制表面的存在了,都按GDI管理不是更好理解??? [/quote] 表面是必要的, 仔细看一看DrvEnableSurface函数 The DrvEnableSurface function sets up a surface to be drawn on and associates it with a given physical device. Comments There are two methods for preparing a surface for use. In this method, which is recommended, the driver creates the surface by a call to EngCreateDeviceSurface. After GDI creates the surface and returns a handle to the driver, the driver calls EngModifySurface, which sets the appropriate hook flags, and optionally, informs GDI of the surface\'s location. The second method is the one used by Windows NT 4.0 drivers. In this method, the driver calls EngCreateBitmap. After this call, the driver calls EngAssociateSurface to associate the surface with the physical display device. This GDI function allows the driver to specify which graphics output routines are supported for standard-format bitmaps. A call to this function can be made only when no surface exists for the given physical device. If a Windows 2000 or later driver is back-ported to run on Windows NT 4.0, this method must be used. If such a driver will also run on Windows 2000 or later, a separate code path in the driver should use the first method. For printer devices, the usual situation is for GDI to collect the graphics directly onto a GDI bitmap. The driver should call EngCreateBitmap, which allows GDI to allocate memory for the bitmap. Any existing GDI bitmap handle is a valid surface handle. For printer graphics DLLs that use GDI-managed surfaces, the DrvEnableSurface function should call EngCreateBitmap, specifying a surface size large enough to contain an entire physical page. If that fails, repeated calls to EngCreateBitmap should be attempted, with decreasing surface sizes, until a call succeeds. The valid size should be specified as input to EngMarkBandingSurface, which informs GDI that surface banding will be necessary. After DrvEnableSurface returns a handle to a primary surface, do not call EngModifySurface or EngAssociateSurface on that handle. Doing so can cause a bug check in certain circumstances. For more information, see Microsoft Knowledge Base article 330248. DrvEnableSurface is required for graphics drivers. |
|
|