0
我構建了一種將文件中的圖像添加到文件並將其存儲在自定義屬性中的方法。這工作正常。檢查文件是否爲圖像
answer file tImageDialogTranslations with type "Images|jpg|jpeg|png"
if it is not empty then
put it into tMyImagePath
put url("binfile:" & tMyImagePath) into tMyImage
put base64encode(tMyImage) into tBase64ImgData
# store image in cust prop
set the cImageBlob of img "img_collection_picture" to tBase64ImgData
#show image
put base64decode(tBase64ImgData) into tShowImage
set the text of image "img_collection_picture" to tShowImage
end if
可悲的是,當我在文件對話框答案添加*
我也可以選擇像txt
另一種文件類型,然後存儲在自定義屬性,但在圖像不顯示。
如何檢查用戶是否真的選擇了有效的圖像文件?
謝謝。我想我可以用 '放入binarydecode(「H8」,tMyImage,tMyImageHex)' ,然後檢查我接受的幾個十六進制值 – Tate83