Delphi 取JPG图片内的Exif信息
2007-05-16 14:35
375 查看
//取Exif信息
function GetExifItem(GPImage:TGPImage;ItemID: PROPID): String;
var
PropSize: UINT;
PropItem: PPropertyItem;
S:PChar;
S1,S2:String;
begin
PropSize := GPImage.GetPropertyItemSize(ItemID);
if PropSize=0 then begin
Result:='';
Exit;
end;
GetMem(PropItem ,PropSize);
GPImage.GetPropertyItem(ItemID, PropSize, PropItem);
//字符
if PropItem.type_= PropertyTagTypeASCII then begin
Result:=PChar(PropItem.Value);
end;
//分数
if (PropItem.type_= PropertyTagTypeRational)
or (PropItem.type_=PropertyTagTypeSRational) then begin
S:=PChar(PropItem.Value);
S1:=IntToHex(Ord(S[3]),2)+IntToHex(Ord(S[2]),2)+
IntToHex(Ord(S[1]),2)+IntToHex(Ord(S[0]),2);
S2:=IntToHex(Ord(S[7]),2)+IntToHex(Ord(S[6]),2)+
IntToHex(Ord(S[5]),2)+IntToHex(Ord(S[4]),2);
Result:=IntToStr(StrToInt('$'+S1))+'/'+IntToStr(StrToInt('$'+S2));
end;
//数字
if PropItem.type_= PropertyTagTypeShort then begin
S:=PChar(PropItem.Value);
S1:=IntToHex(Ord(S[1]),2)+IntToHex(Ord(S[0]),2);
Result:=IntToStr(StrToInt('$'+S1));
end;
//字节
{if PropItem.type_= PropertyTagTypeByte then begin
S:=PChar(PropItem.Value);
S1:=IntToHex(Ord(S[1]),2)+IntToHex(Ord(S[0]),2);
Result:=IntToStr(StrToInt('$'+S1));
end;}
FreeMem(PropItem);
end;
下载: http://download1.csdn.net/down3/20070516/16143519219.zip
function GetExifItem(GPImage:TGPImage;ItemID: PROPID): String;
var
PropSize: UINT;
PropItem: PPropertyItem;
S:PChar;
S1,S2:String;
begin
PropSize := GPImage.GetPropertyItemSize(ItemID);
if PropSize=0 then begin
Result:='';
Exit;
end;
GetMem(PropItem ,PropSize);
GPImage.GetPropertyItem(ItemID, PropSize, PropItem);
//字符
if PropItem.type_= PropertyTagTypeASCII then begin
Result:=PChar(PropItem.Value);
end;
//分数
if (PropItem.type_= PropertyTagTypeRational)
or (PropItem.type_=PropertyTagTypeSRational) then begin
S:=PChar(PropItem.Value);
S1:=IntToHex(Ord(S[3]),2)+IntToHex(Ord(S[2]),2)+
IntToHex(Ord(S[1]),2)+IntToHex(Ord(S[0]),2);
S2:=IntToHex(Ord(S[7]),2)+IntToHex(Ord(S[6]),2)+
IntToHex(Ord(S[5]),2)+IntToHex(Ord(S[4]),2);
Result:=IntToStr(StrToInt('$'+S1))+'/'+IntToStr(StrToInt('$'+S2));
end;
//数字
if PropItem.type_= PropertyTagTypeShort then begin
S:=PChar(PropItem.Value);
S1:=IntToHex(Ord(S[1]),2)+IntToHex(Ord(S[0]),2);
Result:=IntToStr(StrToInt('$'+S1));
end;
//字节
{if PropItem.type_= PropertyTagTypeByte then begin
S:=PChar(PropItem.Value);
S1:=IntToHex(Ord(S[1]),2)+IntToHex(Ord(S[0]),2);
Result:=IntToStr(StrToInt('$'+S1));
end;}
FreeMem(PropItem);
end;
下载: http://download1.csdn.net/down3/20070516/16143519219.zip
相关文章推荐
- Delphi 取JPG图片内的Exif信息
- Delphi 取Jpg图片内的Exif信息(需要GDI Plus)
- Delphi 取JPG图片内的Exif信息
- JPG图片EXIF信息提取工具exif
- jpg图片的Exif及gps信息和示例分析
- 读取JPG图片的Exif属性(一) - Exif信息简介
- JPG图片叠加exif信息
- JPG图片EXIF信息提取工具exif
- 读取JPG图片的Exif属性(三) - Exif属性读取GPS信息代码(C/C++实现)
- 图像处理2_读取JPG图片的Exif属性(一) - Exif信息简介
- jpg图片的Exif及gps信息和示例分析
- JPG图片EXIF信息提取工具exif
- 用C#读取相片(JPG图片)的EXIF信息的方法
- delphi 中 image 控件加载bmp、JPG、GIF、PNG等图片的办法
- 以最省内存的方式把大图片加载到内存及获取Exif信息和获取屏幕高度和宽度的新方法
- 图片 EXIF 信息中旋转参数 Orientation 的理解
- 图片中的Exif信息 的ExifDirectory的大部份常量
- delphi显示jpg、png、gif图片
- 图片文件Exif信息详细说明
- java读取图片的(尺寸、拍摄日期、标记)等EXIF信息