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


C# EmfType类代码示例

本文整理汇总了C#中EmfType的典型用法代码示例。如果您正苦于以下问题:C# EmfType类的具体用法?C# EmfType怎么用?C# EmfType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Metafile

 public Metafile(IntPtr referenceHdc, EmfType emfType, string description)
 {
     System.Drawing.IntSecurity.ObjectFromWin32Handle.Demand();
     IntPtr zero = IntPtr.Zero;
     int status = SafeNativeMethods.Gdip.GdipRecordMetafile(new HandleRef(null, referenceHdc), (int) emfType, System.Drawing.NativeMethods.NullHandleRef, 7, description, out zero);
     if (status != 0)
     {
         throw SafeNativeMethods.Gdip.StatusException(status);
     }
     base.SetNativeImage(zero);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:Metafile.cs

示例2: CreateInternalMetafile

		private void CreateInternalMetafile(EmfType type)
		{
			//Create a temporary bitmap to get an HDC
			Graphics graphics = Component.Instance.CreateGraphics();
			IntPtr hDC = graphics.GetHdc();

			//Create metafile based on type and get graphics handle
			mMetafile = new System.Drawing.Imaging.Metafile(hDC, type);
			graphics.ReleaseHdc(hDC);

			graphics.Dispose();
		}
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:12,代码来源:Metafile.cs

示例3: CreateMetafile

        public static Metafile CreateMetafile(
            this BitmapSource bitmap, 
            double horizontalScale = 1.0,
            double verticalScale = 1.0,
            EmfType emf = EmfType.EmfOnly,
            SmoothingMode smoothingMode = SmoothingMode.HighQuality,
            InterpolationMode interpolationMode = InterpolationMode.HighQualityBicubic,
            PixelOffsetMode pixelOffsetMode = PixelOffsetMode.HighQuality,
            CompositingQuality compositingQuality = CompositingQuality.HighQuality)
        {
            var mf = (Metafile)null;

            using (System.Drawing.Graphics cx = System.Drawing.Graphics.FromHwndInternal(IntPtr.Zero))
            {
                mf = new Metafile(new MemoryStream(), cx.GetHdc(), emf);

                using (var g = System.Drawing.Graphics.FromImage(mf))
                {
                    var img = bitmap.ToBitmap();

                    g.SmoothingMode = smoothingMode;
                    g.InterpolationMode = interpolationMode;
                    g.PixelOffsetMode = pixelOffsetMode;
                    g.CompositingQuality = compositingQuality;

                    var rect =
                        new System.Drawing.RectangleF(
                            0,
                            0,
                            img.PhysicalDimension.Width * (float)horizontalScale,
                            img.PhysicalDimension.Height * (float)verticalScale);

                    g.DrawImage(img, rect);
                }
            }

            return mf;
        }
开发者ID:squaredinfinity,项目名称:Foundation,代码行数:38,代码来源:BitmapSource.extensions.cs

示例4: Metafile

		public Metafile (string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit,
			EmfType type, string description) 
		{
			Status status = GDIPlus.GdipRecordMetafileFileName (fileName, referenceHdc, type, ref frameRect, frameUnit, 
				description, out nativeObject);
			GDIPlus.CheckStatus (status);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:Metafile.cs

示例5: Metafile

	public Metafile(String fileName, IntPtr referenceHdc,
					EmfType type, String description)
			{
				// TODO
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:5,代码来源:Metafile.cs

示例6: Metafile

        public Metafile(string fileName, IntPtr referenceHdc, RectangleF frameRect,
                        MetafileFrameUnit frameUnit, EmfType type, String description)
        {
            IntSecurity.DemandReadFileIO(fileName);
            IntSecurity.ObjectFromWin32Handle.Demand();

            IntPtr metafile = IntPtr.Zero;

            GPRECTF rectf = new GPRECTF(frameRect);
            int status = SafeNativeMethods.Gdip.GdipRecordMetafileFileName(fileName, 
                                                            new HandleRef(null, referenceHdc), 
                                                            unchecked((int)type), 
                                                            ref rectf,
                                                            unchecked((int)frameUnit), 
                                                            description, 
                                                            out metafile);

            if (status != SafeNativeMethods.Gdip.Ok)
                throw SafeNativeMethods.Gdip.StatusException(status);

            SetNativeImage(metafile);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:22,代码来源:Metafile.cs

示例7: Metafile

		public Metafile(EmfType type)
		{
			CreateInternalMetafile(type);	
		}
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:4,代码来源:Metafile.cs

示例8: Metafile

	public Metafile(System.IntPtr referenceHdc, EmfType emfType) {}
开发者ID:Pengfei-Gao,项目名称:source-Insight-3-for-centos7,代码行数:1,代码来源:Metafile.cs

示例9: GdipRecordMetafileFileNameI

		internal static extern Status GdipRecordMetafileFileNameI ([MarshalAs (UnmanagedType.LPWStr)] string filename, IntPtr hdc, EmfType type,
			ref Rectangle frameRect, MetafileFrameUnit frameUnit, [MarshalAs (UnmanagedType.LPWStr)] string description, out IntPtr metafile);
开发者ID:Profit0004,项目名称:mono,代码行数:2,代码来源:gdipFunctions.cs

示例10: GdipRecordMetafileStreamI

		internal static extern Status GdipRecordMetafileStreamI ([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ComIStreamMarshaler))] IStream stream, IntPtr hdc, 
			EmfType type, ref Rectangle frameRect, MetafileFrameUnit frameUnit, [MarshalAs (UnmanagedType.LPWStr)] string description, out IntPtr metafile);
开发者ID:Profit0004,项目名称:mono,代码行数:2,代码来源:gdipFunctions.cs

示例11: GdipRecordMetafileFromDelegateI_linux

		static internal extern Status GdipRecordMetafileFromDelegateI_linux (StreamGetHeaderDelegate getHeader, 
			StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, 
			StreamCloseDelegate close, StreamSizeDelegate size, IntPtr hdc, EmfType type, ref Rectangle frameRect, 
			MetafileFrameUnit frameUnit, [MarshalAs (UnmanagedType.LPWStr)] string description, out IntPtr metafile);
开发者ID:Profit0004,项目名称:mono,代码行数:4,代码来源:gdipFunctions.cs

示例12: RecordFileName

		private void RecordFileName (IntPtr hdc, EmfType type, MetafileFrameUnit unit)
		{
			string filename = String.Format ("test-{0}-{1}.emf", type, unit);
			IntPtr metafile;
			RectangleF rect = new RectangleF (10, 20, 100, 200);
			Status status = GDIPlus.GdipRecordMetafileFileName (filename, hdc, type, ref rect, unit, filename, out metafile);
			if (metafile != IntPtr.Zero)
				GDIPlus.GdipDisposeImage (metafile);
			if (status == Status.Ok)
				File.Delete (filename);
			Assert.AreEqual (Status.Ok, status, filename);
		}
开发者ID:RobertZenz,项目名称:mono,代码行数:12,代码来源:GDIPlusTest.cs

示例13: GetMetafile

 public Metafile GetMetafile(EmfType type)
 {
     int w = this.ClientRectangle.Width;
     int h = this.ClientRectangle.Height;
     Metafile metafile;
     using (var g = CreateGraphics())
     {
         IntPtr hdc = g.GetHdc();
         metafile = new Metafile(hdc, type);
         g.ReleaseHdc(hdc);
     }
     using (var g = Graphics.FromImage(metafile))
         DoPaint(g, w, h);
     return metafile;
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:15,代码来源:Chart.cs


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