示例#1
0
 public void TranslateTransform(float dx, float dy, MatrixOrder order)
 {
     Gdip.CheckStatus(Gdip.GdipTranslateLineTransform(
                          new HandleRef(this, NativeBrush), dx, dy, order));
 }
示例#2
0
 /// <summary>
 /// Gets a bounding rectangle in the specified units for this <see cref='Image'/>.
 /// </summary>
 public RectangleF GetBounds(ref GraphicsUnit pageUnit)
 {
     Gdip.CheckStatus(Gdip.GdipGetImageBounds(new HandleRef(this, nativeImage), out RectangleF bounds, out pageUnit));
     return(bounds);
 }
示例#3
0
 internal static bool EndPage(GraphicsPrinter gr)
 {
     Gdip.GdipGetPostScriptSavePage(gr.Hdc);
     return(true);
 }
示例#4
0
 public Matrix(float m11, float m12, float m21, float m22, float dx, float dy)
 {
     Gdip.CheckStatus(Gdip.GdipCreateMatrix2(m11, m12, m21, m22, dx, dy, out IntPtr nativeMatrix));
     NativeMatrix = nativeMatrix;
 }
 public void ResetTransform()
 {
     Gdip.CheckStatus(Gdip.GdipResetPathGradientTransform(new HandleRef(this, NativeBrush)));
 }
示例#6
0
 public static Graphics FromHwndInternal(IntPtr hwnd)
 {
     Gdip.CheckStatus(Gdip.GdipCreateFromHWND(hwnd, out IntPtr nativeGraphics));
     return(new Graphics(nativeGraphics));
 }
示例#7
0
 public static Graphics FromHdcInternal(IntPtr hdc)
 {
     Gdip.CheckStatus(Gdip.GdipCreateFromHDC(hdc, out IntPtr nativeGraphics));
     return(new Graphics(nativeGraphics));
 }
示例#8
0
 public void Scale(float scaleX, float scaleY, MatrixOrder order)
 {
     Gdip.CheckStatus(Gdip.GdipScaleMatrix(new HandleRef(this, NativeMatrix), scaleX, scaleY, order));
 }
示例#9
0
 public void Rotate(float angle, MatrixOrder order)
 {
     Gdip.CheckStatus(Gdip.GdipRotateMatrix(new HandleRef(this, NativeMatrix), angle, order));
 }
示例#10
0
 public Matrix Clone()
 {
     Gdip.CheckStatus(Gdip.GdipCloneMatrix(new HandleRef(this, NativeMatrix), out IntPtr clonedMatrix));
     return(new Matrix(clonedMatrix));
 }
示例#11
0
 public void Translate(float offsetX, float offsetY, MatrixOrder order)
 {
     Gdip.CheckStatus(Gdip.GdipTranslateMatrix(
                          new HandleRef(this, NativeMatrix),
                          offsetX, offsetY, order));
 }
示例#12
0
        public Metafile(IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader)
        {
            int status = Gdip.GdipCreateMetafileFromEmf(hmetafile, false, out nativeImage);

            Gdip.CheckStatus(status);
        }
示例#13
0
 public void RotateTransform(float angle, MatrixOrder order)
 {
     Gdip.CheckStatus(Gdip.GdipRotateLineTransform(
                          new HandleRef(this, NativeBrush), angle, order));
 }
示例#14
0
 public void ScaleTransform(float sx, float sy, MatrixOrder order)
 {
     Gdip.CheckStatus(Gdip.GdipScaleLineTransform(
                          new HandleRef(this, NativeBrush), sx, sy, order));
 }
示例#15
0
 public void AddBezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
 {
     Gdip.CheckStatus(Gdip.GdipAddPathBezierI(
                          new HandleRef(this, _nativePath),
                          x1, y1, x2, y2, x3, y3, x4, y4));
 }
示例#16
0
 public void StartFigure()
 {
     Gdip.CheckStatus(Gdip.GdipStartPathFigure(new HandleRef(this, _nativePath)));
 }
示例#17
0
        public object Clone()
        {
            Gdip.CheckStatus(Gdip.GdipClonePath(new HandleRef(this, _nativePath), out IntPtr clonedPath));

            return(new GraphicsPath(clonedPath, 0));
        }
示例#18
0
 public void CloseAllFigures()
 {
     Gdip.CheckStatus(Gdip.GdipClosePathFigures(new HandleRef(this, _nativePath)));
 }
示例#19
0
 public void ReleaseHdcInternal(IntPtr hdc)
 {
     Gdip.CheckStatus(!Gdip.Initialized ? Gdip.Ok :
                      Gdip.GdipReleaseDC(new HandleRef(this, NativeGraphics), hdc));
     _nativeHdc = IntPtr.Zero;
 }
示例#20
0
 public void SetMarkers()
 {
     Gdip.CheckStatus(Gdip.GdipSetPathMarker(new HandleRef(this, _nativePath)));
 }
示例#21
0
 public static Graphics FromHdc(IntPtr hdc, IntPtr hdevice)
 {
     Gdip.CheckStatus(Gdip.GdipCreateFromHDC2(hdc, hdevice, out IntPtr nativeGraphics));
     return(new Graphics(nativeGraphics));
 }
示例#22
0
 public void ClearMarkers()
 {
     Gdip.CheckStatus(Gdip.GdipClearPathMarkers(new HandleRef(this, _nativePath)));
 }
示例#23
0
 /// <summary>
 /// Returns a Windows handle to an enhanced <see cref='Metafile'/>.
 /// </summary>
 public IntPtr GetHenhmetafile()
 {
     Gdip.CheckStatus(Gdip.GdipGetHemfFromMetafile(new HandleRef(this, nativeImage), out IntPtr hEmf));
     return(hEmf);
 }
示例#24
0
 public void Reverse()
 {
     Gdip.CheckStatus(Gdip.GdipReversePath(new HandleRef(this, _nativePath)));
 }
示例#25
0
 public override object Clone()
 {
     Gdip.CheckStatus(Gdip.GdipCloneBrush(new HandleRef(this, NativeBrush), out IntPtr clonedBrush));
     return(new PathGradientBrush(clonedBrush));
 }
示例#26
0
 public PointF GetLastPoint()
 {
     Gdip.CheckStatus(Gdip.GdipGetPathLastPoint(new HandleRef(this, _nativePath), out PointF point));
     return(point);
 }
示例#27
0
 public GraphicsPath(FillMode fillMode)
 {
     Gdip.CheckStatus(Gdip.GdipCreatePath(unchecked ((int)fillMode), out IntPtr nativePath));
     _nativePath = nativePath;
 }
示例#28
0
 public void AddLine(int x1, int y1, int x2, int y2)
 {
     Gdip.CheckStatus(Gdip.GdipAddPathLineI(new HandleRef(this, _nativePath), x1, y1, x2, y2));
 }
示例#29
0
        public void AddArc(RectangleF rect, float startAngle, float sweepAngle)
        {
            int status = Gdip.GdipAddPathArc(_nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);

            Gdip.CheckStatus(status);
        }
示例#30
0
 /// <summary>
 /// Adds a font contained in system memory to this <see cref='System.Drawing.Text.PrivateFontCollection'/>.
 /// </summary>
 public void AddMemoryFont(IntPtr memory, int length)
 {
     Gdip.CheckStatus(Gdip.GdipPrivateAddMemoryFont(new HandleRef(this, _nativeFontCollection), memory, length));
 }