vfp如何获取图形文件的像素
主要是:jpg和bmp的文件宽和高的像素。
取得后用myfil的Thumbnail函数 等比缩小图形
[解决办法]
lcImageName='c:\abc.jpg'
Declare Integer GdipLoadImageFromFile In GDIPlus.Dll String wFilename, Integer @nImage
Declare Integer GdipGetImageWidth In GDIPlus Integer img,Integer @ imgwidth
Declare Integer GdipGetImageHeight In GDIPlus Integer img,Integer @ imgheight
Declare Integer GdipDisposeImage In GDIPlus.Dll Long nativeImage
Store 0 To nImage,nWidth,nHeight
GdipLoadImageFromFile(Strconv(lcImageName+Chr(0),5),@nImage)
GdipGetImageWidth(nImage,@nWidth)
GdipGetImageHeight(nImage,@nHeight)
GdipDisposeImage(nImage)
?'图片宽度:',nWidth
?'图片高度:',nHeight