如果你的图片是批量制作的,它们的DPI通常是一致的,可以直接在资源管理器中查到:
授人以渔,不授人以鱼。
SET PATH TO HOME() + "\FFC" lcName = "Z:\test\VFP\China 06.JPG" lcMessage = "" loImage = NEWOBJECT("gpImage", "_GDIPlus.vcx") WITH loImage .CreateFromFile(lcName) lcMessage = "水平分辨率: " + TRANSFORM(.HorizontalResolution) + CHR(13)+CHR(10) + ; "垂直分辨率: " + TRANSFORM(.VerticalResolution) + CHR(13)+CHR(10) + ; "水平像素: " + TRANSFORM(.ImageWidth) + CHR(13)+CHR(10) + ; "垂直像素: " + TRANSFORM(.ImageHeight) + CHR(13)+CHR(10) ENDWITH MESSAGEBOX(lcMessage) RELEASE loImage