首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > PB >

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

2012-03-25 
关于PB中,宽高一样,但不是正方形的问题请教powerbuilder 窗口或数据窗口中的对象width height 相同,但看起

关于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!)

热点排行