如何将vb6的高宽单位转换为C#的像素?

解决方案 »

  1.   

    vb的宽度单位是缇(twips),可以用Screen.TwipsPerPixelX 和 Screen.TwipsPerPixelY 进行转换
      

  2.   

    同意,你还可以改变默认的单位,修改窗体的ScaleMode属性
      

  3.   

    屏幕输出:
    width:Pixel=Twips / Screen.TwipsPerPixelX
    height: Pixel=Twips / Screen.TwipsPerPixelY打印机输出:
    width:Pixel=Twips / Printer.TwipsPerPixelX
    height: Pixel=Twips / Printer.TwipsPerPixelYTwipsPerPixelx 就是 Twips Per Pixel X,翻译过来就是缇每像素的意思,看来你的英语水平实在不咋地啊。
      

  4.   

    屏幕输出:
    width:Pixel=Twips / Screen.TwipsPerPixelX
    height: Pixel=Twips / Screen.TwipsPerPixelY打印机输出:
    width:Pixel=Twips / Printer.TwipsPerPixelX
    height: Pixel=Twips / Printer.TwipsPerPixelY 
      

  5.   

    依據表單的ScaleMode屬性內容來定的。
    默認為Twip.
      

  6.   

    Debug.Print Screen.Width \ Screen.TwipsPerPixelX '屏幕的宽度 
    Debug.Print Screen.Height \ Screen.TwipsPerPixelY '屏幕的长度
      

  7.   

    没错。这个twips真的恶心啊...