|
VFP 愛用者社區 本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
|
上一篇主題 :: 下一篇主題 |
發表人 |
內容 |
garfield Site Admin
註冊時間: 2003-01-30 文章: 2158
第 1 樓
|
發表於: 星期二 七月 14, 2020 11:40 am 文章主題: 取得 jpg 檔 exif 資訊 |
|
|
資料來源: https://www.tek-tips.com/viewthread.cfm?qid=1173924
代碼: |
Img = CreateObject("WIA.ImageFile")
Img.LoadFile ("C:WINDOWS\Web\WallpaperBliss.bmp")
s = "Width = " + TRANSFORM(Img.Width) + chr(13) + ;
"Height = " + TRANSFORM(Img.Height) + chr(13) + ;
"Depth = " + TRANSFORM(Img.PixelDepth) + chr(13) + ;
"HorizontalResolution = " + TRANSFORM(Img.HorizontalResolution) + chr(13) + ;
"VerticalResolution = " + TRANSFORM(Img.VerticalResolution) + chr(13) + ;
"FrameCount = " + TRANSFORM(Img.FrameCount) + chr(13)
If Img.IsIndexedPixelFormat
s = s + "Pixel data contains palette indexes" + chr(13)
EndIf
If Img.IsAlphaPixelFormat
s = s + "Pixel data has alpha information" + chr(13)
EndIf
If Img.IsExtendedPixelFormat
s = s + "Pixel data has extended color information (16 bit/channel)" + chr(13)
EndIf
If Img.IsAnimated
s = s + "Image is animated" + chr(13)
EndIf
If Img.Properties.Exists("40091")
v = Img.Properties("40091").Value
s = s + "Title = " + v.String + chr(13)
EndIf
If Img.Properties.Exists("40092")
v = Img.Properties("40092").Value
s = s + "Comment = " + v.String + chr(13)
EndIf
If Img.Properties.Exists("40093")
v = Img.Properties("40093").Value
s = s + "Author = " + v.String + chr(13)
EndIf
If Img.Properties.Exists("40094")
v = Img.Properties("40094").Value
s = s + "Keywords = " + v.String + chr(13)
EndIf
If Img.Properties.Exists("40095")
v = Img.Properties("40095").Value
s = s + "Subject = " + v.String + chr(13)
EndIf
MESSAGEBOX( s)
|
for i=1 to img.Properties.Count
? img.Properties(i).Name
next
**打算在圖檔裡加上文字註解, 目前還不會 XD
img.SaveFile(圖檔名) _________________ 利用>>搜尋<<的功能會比問的還要快得到答案. |
|
回頂端 |
|
|
garfield Site Admin
註冊時間: 2003-01-30 文章: 2158
第 2 樓
|
發表於: 星期二 七月 14, 2020 11:50 am 文章主題: |
|
|
代碼: |
另一種方式
mfile ='d:\mydocument\picture\garfield.jpg'
showfiledata( mfile )
Procedure showfiledata
Lparameters tcPicFullPath
oShell = Createobject("Shell.Application")
oFolder = oShell.Namespace(Justpath(tcPicFullPath))
With oFolder
For Each cFile In oFolder.Items
If Upper(cFile.Name) <> Upper(Justfname(tcPicFullPath))
Loop
Endif
For i = 0 To 34
?.GetDetailsOf(oFolder.Items, i) + ": " + .GetDetailsOf(cFile, i)
Endfor
Endfor
Endwith
Return
|
_________________ 利用>>搜尋<<的功能會比問的還要快得到答案. |
|
回頂端 |
|
|
lygcw9603
註冊時間: 2011-12-25 文章: 129
第 3 樓
|
發表於: 星期六 八月 01, 2020 9:10 am 文章主題: |
|
|
學習了 |
|
回頂端 |
|
|
|
|
您 無法 在這個版面發表文章 您 無法 在這個版面回覆文章 您 無法 在這個版面編輯文章 您 無法 在這個版面刪除文章 您 無法 在這個版面進行投票 您 無法 在這個版面附加檔案 您 無法 在這個版面下載檔案
|
|