lsp有什么函数可以读取照片的像素吗
;;(test "d:\\DJI_0002.JPG")
;;返回图片的宽度、高度、水平分辨率、数值分辨率
(defun test(p)
(setq oba (vlax-get-or-create-object "WIA.ImageFile"))
(vlax-invoke-method oba 'LoadFile p)
(mapcar '(lambda(x)(vlax-get-property oba x))
(list 'Width 'Height 'HorizontalResolution 'VerticalResolution)
))
用api可以, yxp 发表于 2018-6-9 12:54
:victory:太厉害了,刚好也是我需要的。
稍微修改了一下,获取相片的拍摄日期
;;(ZA:GetPicDTDigitized "d:\\1.JPG")
(defun ZA:GetPicDTDigitized (fn / DATE LL NAME VLA METHOD)
;;;(setq fn "d:\\123.jpg")
(setq Vla (vlax-get-or-create-object "WIA.ImageFile"))
(setq method (vl-catch-all-apply 'vlax-invoke-method (list Vla 'LoadFile fn)))
(cond
((Not (vl-catch-all-error-p method))
;;;(setq Lst (list 'Width 'Height 'HorizontalResolution 'VerticalResolution))
;;;(mapcar '(lambda(x) (vlax-get-property Vla x)) Lst)
(setq LL (vlax-get-property Vla 'properties))
;;;(vlax-for i LL (setq Lst2 (cons i Lst2)))
(vlax-for item LL
;;; (setq item (nth 26 Lst2))
(setq Name (vlax-get-property item 'name))
(cond
((= Name "ExifDTDigitized")
(setq Date (vlax-variant-value (vlax-get-property item 'value))))
(t nil)))
(vlax-release-object Vla)
Date
)
(t nil)
)
) yxp 发表于 2018-6-9 12:54
大佬能不能出一个提取gps经纬度的呢? 做个记号,备用
页:
[1]