当前位置: 首页>>代码示例>>C#>>正文


C# Header.Dump方法代码示例

本文整理汇总了C#中Header.Dump方法的典型用法代码示例。如果您正苦于以下问题:C# Header.Dump方法的具体用法?C# Header.Dump怎么用?C# Header.Dump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Header的用法示例。


在下文中一共展示了Header.Dump方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Save

		public void Save ()
		{
			string desc = "this is an example description";
			string desc2 = "\x00a9 Novell Inc.";
			PixbufOrientation orient = PixbufOrientation.TopRight;
			Gdk.Pixbuf test = new Gdk.Pixbuf (null, "f-spot-32.png");
			string path = ImageFile.TempPath ("joe.jpg");
			
			PixbufUtils.SaveJpeg (test, path, 75, new Exif.ExifData ());
			JpegFile jimg = new JpegFile (path);
			jimg.SetDescription (desc);
			jimg.SetOrientation (orient);
			jimg.SaveMetaData (path);
			JpegFile mod = new JpegFile (path);
			Assert.AreEqual (mod.Orientation, orient);
			Assert.AreEqual (mod.Description, desc);
			jimg.SetDescription (desc2);
			jimg.SaveMetaData (path);
			mod = new JpegFile (path);
			Assert.AreEqual (mod.Description, desc2);
			
			Header header = mod.ExifHeader;
#if USE_TEST_FILE
			string tmp = "/home/lewing/test.tiff";
			if (File.Exists (tmp))
				File.Delete (tmp);
			Stream stream = File.Open (tmp, FileMode.Create, FileAccess.ReadWrite);
			Console.WriteLine ("XXXX saving tiff {0}", tmp);
#else
			System.IO.MemoryStream stream = new System.IO.MemoryStream ();
#endif

			header.Dump ("source");
			header.Save (stream);
			stream.Position = 0;
			System.Console.WriteLine ("----------------------------------------------LOADING TIFF");
			Header loader = new Header (stream);
			loader.Dump ("loader");
			
			CompareDirectories (header.Directory, loader.Directory);

			System.IO.File.Delete (path);	
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:43,代码来源:Tiff.cs

示例2: TiffFile

		public TiffFile (Uri uri) : base (uri)
		{
			try {
				using (System.IO.Stream input = Open ()) {
					this.Header = new Header (input);
				}

#if DEBUG_LOADER
				Header.Dump (this.ToString () + ":");
#endif
			} catch (System.Exception e) {
				System.Console.WriteLine (e.ToString ());
			}
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:14,代码来源:Tiff.cs

示例3: LoadBuffer

		public static FSpot.Imaging.PixelBuffer LoadBuffer (Stream stream)
		{

			Header header = new Header (stream);
			header.Dump (); 

			switch (header.Magic) {
			case "P6":
				if (header.IsDeep)
					return LoadBufferRGB16 (stream, header.Width, header.Height);
				else
					return LoadBufferRGB8 (stream, header.Width, header.Height);
			default:
				throw new System.Exception (System.String.Format ("unknown pnm type {0}", header.Magic));
			}			
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:16,代码来源:PnmFile.cs

示例4: Load

		public static Gdk.Pixbuf Load (Stream stream)
		{
			Header header = new Header (stream);
			header.Dump ();

			switch (header.Magic) {
			case "P6":
				if (header.IsDeep) {
#if SKIP_BUFFER					
					return LoadRGB16 (stream, header.Width, header.Height);
#else
					stream.Position = 0;
					FSpot.Imaging.PixelBuffer image = FSpot.Pnm.PnmFile.LoadBuffer (stream);
					Gdk.Pixbuf result = image.ToPixbuf (Cms.Profile.CreateStandardRgb ());
					return result;
#endif
				} else
					return LoadRGB8 (stream, header.Width, header.Height);
			default:
				throw new System.Exception (System.String.Format ("unknown pnm type {0}", header.Magic));
			}			
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:22,代码来源:PnmFile.cs

示例5: TiffFile

		public TiffFile (Uri uri) : base (uri)
		{
			try {
				using (System.IO.Stream input = Open ()) {
					this.Header = new Header (input);
				}

#if DEBUG_LOADER
				Header.Dump (this.ToString () + ":");
#endif
			} catch (System.Exception e) {
				Beagle.Util.Log.Error (e, "Error loading TIFF file {0}", uri);
			}
		}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:14,代码来源:Tiff.cs


注:本文中的Header.Dump方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。