获取图片的宽和高(像素)

作者在 2015-02-18 19:14:43 发布以下内容



* 方法一  
cImg = Getpict()   && 获取 bmp, jpg, gif  
  
xImgObj = LoadPicture(cImg)  
With xImgObj  
    lnWidth = Int(.Width/26.458)  
    lnHeight = Int(.Height/26.458)  
Endwith  
  
Messagebox("宽度 = " + Transform(lnWidth) + "(像数)" + Chr(13) + ;  
    "高度 = " + Transform(lnHeight) + "(像数)")  
  
* 方法二   
  
cc = Sys(2015)  
_Screen.NewObject(cc, 'Image')  
With GetPem(_Screen, cc) as Image  
    .Picture = GetPict()  
    ? '图片宽度', .Width  
    ? '图片高度', .Height  
EndWith  
_Screen.RemoveObject(cc)
方法三
op = CREATEOBJECT("Image")
op.Picture = GETPICT()
? "Width  : ", op.Width
? "Height : ", op.Height
  


来源 http://bbs.csdn.net/topics/390972202  

图像(Image)问题 | 阅读 2023 次
文章评论,共0条
游客请输入验证码
浏览379442次