1

我有这个代码:

PropertyItem propertyItem;
int degree = 10, minutes = 10, second = 10;
unsigned long ulExifCoordFormat[6] = {degree, 1, minutes, 1, second, 1};
propertyItem.id = PropertyTagGpsLongitude;
propertyItem.type=PropertyTagTypeRational;
propertyItem.length = sizeof( unsigned long ) * 6;
propertyItem.value =ulExifCoordFormat;
bitmap->Setproperty(&propertyItem);

此代码应设置,Longitude to 10,10,10,但将其设置为一些错误的值。

用于设置纬度的类似代码可以正常工作:

PropertyItem propertyItem;
int degree = 20, minutes = 20, second = 20;
unsigned long ulExifCoordFormat[6] = {degree, 1, minutes, 1, second, 1};
propertyItem.id = PropertyTagGpsLatitude;
propertyItem.type=PropertyTagTypeRational;
propertyItem.length = sizeof( unsigned long ) * 6;
propertyItem.value =ulExifCoordFormat;
bitmap->Setproperty(&propertyItem);

该代码基于此 MSDN 文档:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms533832(v=vs.85).aspx

和这篇文章:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/20c004d6-1815-42da-aa04-03b4a895bef6/using-gdi-image-class-to-store-gps-information?forum=vcgeneral

编辑 1

刚刚注意到这取决于我先设置哪个。第一个设置正确,第二个设置不正确。显然我只能用这个功能添加一个项目。如何同时设置多个项目?

4

0 回答 0