本文整理汇总了C#中FlickrNet.Flickr.PhotosGeoSetLocation方法的典型用法代码示例。如果您正苦于以下问题:C# Flickr.PhotosGeoSetLocation方法的具体用法?C# Flickr.PhotosGeoSetLocation怎么用?C# Flickr.PhotosGeoSetLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlickrNet.Flickr
的用法示例。
在下文中一共展示了Flickr.PhotosGeoSetLocation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Upload
public string Upload(WitnessKingTidesApiInputModel model)
{
string flickrId = string.Empty;
model.FileName = Guid.NewGuid().ToString() + ".jpg";
var flickr = new Flickr(FlickrApiKey, FlickrApiSecret);
flickr.OAuthAccessToken = FlickrOAuthKey;
flickr.OAuthAccessTokenSecret = FlickrOAuthSecret;
var path = Path.Combine(AppDataDirectory, model.FileName);
using (var stream = File.OpenWrite(path))
{
stream.Write(model.Photo, 0, model.Photo.Length);
}
//TODO: We should probably fill the title here. Otherwise default flickr captions will be gibberish guids
flickrId = flickr.UploadPicture(path, null, model.Description, null, true, false, false);
//TODO: Should probably try/catch this section here. Failure to set location and/or delete the temp file should
//not signal a failed upload.
//TODO: Need to check if coordinates can be embedded in EXIF and extracted by Flickr. If so we can probably
//skip this and embed the coordinates client-side.
flickr.PhotosGeoSetLocation(flickrId, Convert.ToDouble(model.Latitude), Convert.ToDouble(model.Longitude));
File.Delete(path);
return flickrId;
}