2,726
社区成员
发帖
与我相关
我的任务
分享
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) + "(像数)")
fn = GetPict('jpg')
fp = FOPEN(fn)
If fp > 0
cHeader = Fread(fp, 65533)
nSOF0 = At(0hffc0, m.cHeader)
If nSOF0 > 0
FSEEK(fp, nSOF0 + 4)
? '文件', fn
? '偏移', nSOF0 + 4
? '高度', ASC(FREAD(fp, 1)) * 256 + ASC(FREAD(fp, 1))
? '宽度', ASC(FREAD(fp, 1)) * 256 + ASC(FREAD(fp, 1))
EndIf
FCLOSE(fp)
EndIf
cc = Sys(2015)
_Screen.NewObject(cc, 'Image')
With GetPem(_Screen, cc) as Image
.Picture = GetPict()
? '图片宽度', .Width
? '图片高度', .Height
EndWith
_Screen.RemoveObject(cc)