本文整理汇总了C#中IFilter.Convert方法的典型用法代码示例。如果您正苦于以下问题:C# IFilter.Convert方法的具体用法?C# IFilter.Convert怎么用?C# IFilter.Convert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFilter
的用法示例。
在下文中一共展示了IFilter.Convert方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: useFilter
private void useFilter(IFilter filter)
{
PictureForm activeChild = (PictureForm)this.ActiveMdiChild;
filter.setImage(activeChild.bitmap);
if (filter.hasDialog)
if (!filter.showDialog())
return;
filter.Convert();
activeChild.refresh();
}
示例2: Upload
public string Upload(IPhoto photo, IFilter filter, bool is_public, bool is_family, bool is_friend)
{
if (token == null) {
throw new Exception ("Must Login First");
}
// FIXME flickr needs rotation
string error_verbose;
using (FilterRequest request = new FilterRequest (photo.DefaultVersion.Uri)) {
try {
string tags = null;
filter.Convert (request);
string path = request.Current.LocalPath;
if (ExportTags && photo.Tags != null) {
StringBuilder taglist = new StringBuilder ();
FSpot.Core.Tag [] t = photo.Tags;
FSpot.Core.Tag tag_iter = null;
for (int i = 0; i < t.Length; i++) {
if (i > 0)
taglist.Append (",");
taglist.Append (String.Format ("\"{0}\"", t[i].Name));
// Go through the tag parents
if (ExportTagHierarchy) {
tag_iter = t[i].Category;
while (tag_iter != App.Instance.Database.Tags.RootCategory && tag_iter != null) {
// Skip top level tags because they have no meaning in a linear tag database
if (ExportIgnoreTopLevel && tag_iter.Category == App.Instance.Database.Tags.RootCategory) {
break;
}
// FIXME Look if the tag is already there!
taglist.Append (",");
taglist.Append (String.Format ("\"{0}\"", tag_iter.Name));
tag_iter = tag_iter.Category;
}
}
}
tags = taglist.ToString ();
}
try {
string photoid =
flickr.UploadPicture (path, photo.Name, photo.Description, tags, is_public, is_family, is_friend);
return photoid;
} catch (FlickrNet.FlickrException ex) {
Log.Error ("Problems uploading picture: " + ex.ToString());
error_verbose = ex.ToString();
}
} catch (Exception e) {
// FIXME we need to distinguish between file IO errors and xml errors here
throw new System.Exception ("Error while uploading", e);
}
}
throw new System.Exception (error_verbose);
}
示例3: Upload
public string Upload (IBrowsableItem photo, IFilter filter, bool is_public, bool is_family, bool is_friend)
{
if (token == null) {
throw new Exception ("Must Login First");
}
// FIXME flickr needs rotation
string error_verbose;
using (FilterRequest request = new FilterRequest (photo.DefaultVersionUri)) {
try {
string tags = null;
filter.Convert (request);
string path = request.Current.LocalPath;
if (ExportTags && photo.Tags != null) {
StringBuilder taglist = new StringBuilder ();
Tag [] t = photo.Tags;
for (int i = 0; i < t.Length; i++) {
if (i > 0)
taglist.Append (",");
taglist.Append (String.Format ("\"{0}\"", t[i].Name));
}
tags = taglist.ToString ();
}
try {
string photoid =
flickr.UploadPicture (path, photo.Name, photo.Description, tags, is_public, is_family, is_friend);
return photoid;
} catch (FlickrNet.FlickrException ex) {
Console.WriteLine ("Problems uploading picture: " + ex.ToString());
error_verbose = ex.ToString();
}
} catch (Exception e) {
// FIXME we need to distinguish between file IO errors and xml errors here
throw new System.Exception ("Error while uploading", e);
}
}
throw new System.Exception (error_verbose);
}