当前位置: 代码迷 >> PB >> 关于PB中,宽高一样,但不是正方形的有关问题请问
  详细解决方案

关于PB中,宽高一样,但不是正方形的有关问题请问

热度:30   发布时间:2016-04-29 08:37:35.0
关于PB中,宽高一样,但不是正方形的问题请教
powerbuilder 窗口或数据窗口中的对象width height 相同,但看起来并不是正方形,怎么回事?如何处理?

------解决方案--------------------
你可以反过来,以高度来决定宽度
long ll_height
ll_height= unitstopixels(height, yunitstopixels!)
width= pixelstounits(ll_height, xpixelstounits!)

或者确定高度与宽度都为一个常量,如300像素
width = pixelstounits(300, xpixelstounits!)
height = pixelstounits(300, ypixelstounits!)

  相关解决方案