MSDN中描述是
Scaling factor for the x-axis of the printer
Scaling factor for the y-axis of the printer但是GetDeviceCaps()返回的是一个int.那么这个factor是什么含义呢?好像缺一个基准的定义。
是不是一个百分数,比如返回90就是指缩小到90%?

解决方案 »

  1.   

    SCALINGFACTORX:打印机x轴的比例系数;SCALINGFACTORY:打印机y轴的比例系数。
      

  2.   

    to:Waiting4you 比如1代表1/2,   2代表1/4那怎么表示90%? 不太会吧!
      

  3.   

    我也不敢肯定,我测试时总是返回0MSDN上有一段文字是这样说的:Escape函数里的一段描述:GETSCALINGFACTOR Retrieves the scaling factors for the x-axis and the y-axis of a printer. 
    This escape has been superseded by SCALINGFACTORX and SCALINGFACTORY in GetDeviceCaps.
    CDC::SelectClipRgn函数里的一段描述:Applications that must take the scaling of graphics objects in the GDI can use the GETSCALINGFACTOR printer escape to determine the scaling factor. This scaling factor affects clipping. If a region is used to clip graphics, GDI divides the coordinates by the scaling factor. If the region is used to clip text, GDI makes no scaling adjustment. A scaling factor of 1 causes the coordinates to be divided by 2; a scaling factor of 2 causes the coordinates to be divided by 4; and so on.
      

  4.   

    int GetDeviceCaps(
      HDC hdc,     // handle to DC
      int nIndex   // index of capability
    );The return value specifies the value of the desired item. When nIndex is BITSPIXEL and the device has 15bpp or 16bpp,the return value is 16.
    (因为参数BITSPIXEL指定了要求得到的是Number of adjacent color bits for each pixel,bpp就是bits per pixel),其它的类推。
      

  5.   

    to:Waiting4you
    多谢了你的信息。
    我的测试也总是返回0。不过我目前只有两台打印机。改变缩放的设置后。DC的DPI有改变,但是这样的改变使你无法重新推算paper的尺寸。如果我坚持用图像指定DPI来打印,也可以体现这个变化,但是当图像是fit to可打印的区域时这个值就无法体现出来。虽然问题不是很大。但是想找老袁确定一下。以免那天出错了。毕竟他做过打印驱动,而且原来在微软专门做这个方面。
      

  6.   

    好像没有找到说明,不过从网上搜索到一个帖子,希望对楼主有帮助
    http://www.zlsoft.com/techbbs/dispbbs.asp?boardid=46&id=471
      

  7.   

    I've never used it.Why do you want to use it?
    What're you trying to achieve?
      

  8.   

    Thanks for the message, at least I know I can ignore this value. Looks like most people do.The reason I try to use it is I don't want to make mistake.You know printer allow you to set scale when you print out. Like 90%
    Base on my testing of two printers, they change the DPI in the returned DC.
    In this case, the paper size (inches) of the DC is resized too, and Looks like I cannot get correct paper size. (I found PhotoShop7.0 has similar issue)I am not sure whether printer driver suppose to change DPI or not. And I saw these parameters in MSDN. So I want to know whether I should use these parameters or just ignore them.