public void UpdateValues(object model) { // Make sure both objects exist and aren't the same if (model != null && model is PenStateModel && model != this) { PenStateModel m = (PenStateModel)model; using (Synchronizer.Lock(this.SyncRoot)) { using (Synchronizer.Lock(m.SyncRoot)) { if (this.m_PenRasterOperation != m.m_PenRasterOperation) { this.m_PenRasterOperation = m.m_PenRasterOperation; } if (this.m_PenTip != m.m_PenTip) { this.m_PenTip = m.m_PenTip; } if (this.m_PenColor != m.m_PenColor) { this.m_PenColor = m.m_PenColor; } if (this.m_PenWidth != m.m_PenWidth) { this.m_PenWidth = m.m_PenWidth; } if (this.m_PenHeight != m.m_PenHeight) { this.m_PenHeight = m.m_PenHeight; } if (this.m_HLRasterOperation != m.m_HLRasterOperation) { this.m_HLRasterOperation = m.m_HLRasterOperation; } if (this.m_HLTip != m.m_HLTip) { this.m_HLTip = m.m_HLTip; } if (this.m_HLColor != m.m_HLColor) { this.m_HLColor = m.m_HLColor; } if (this.m_HLWidth != m.m_HLWidth) { this.m_HLWidth = m.m_HLWidth; } if (this.m_HLHeight != m.m_HLHeight) { this.m_HLHeight = m.m_HLHeight; } } } } }
public DrawingAttributesSerializer(SerializedPacket p) { this.AntiAliased = SerializedPacket.DeserializeBool(p.GetNextPart()); this.Color = SerializedPacket.DeserializeColor(p.GetNextPart()); this.ExtendedProperties = new ArrayList(); this.FitToCurve = SerializedPacket.DeserializeBool(p.GetNextPart()); this.Height = SerializedPacket.DeserializeFloat(p.GetNextPart()); this.IgnorePressure = SerializedPacket.DeserializeBool(p.GetNextPart()); this.PenTip = (PenTip)SerializedPacket.DeserializeLong(p.GetNextPart()); this.RasterOperation = (RasterOperation)SerializedPacket.DeserializeLong(p.GetNextPart()); this.Transparency = SerializedPacket.DeserializeByte(p.GetNextPart()); this.Width = SerializedPacket.DeserializeFloat(p.GetNextPart()); }
public DrawingAttributesSerializer(DrawingAttributes atts) { this.AntiAliased = atts.AntiAliased; this.Color = atts.Color; this.ExtendedProperties = new ArrayList(atts.ExtendedProperties); this.FitToCurve = atts.FitToCurve; this.Height = atts.Height; this.IgnorePressure = atts.IgnorePressure; this.PenTip = atts.PenTip; this.RasterOperation = atts.RasterOperation; this.Transparency = atts.Transparency; this.Width = atts.Width; }
public PenStateModel() { DrawingAttributes atts = new DrawingAttributes(); this.m_PenRasterOperation = RasterOperation.CopyPen; this.m_PenTip = PenTip.Ball; this.m_PenColor = Color.Orange.ToArgb(); this.m_PenWidth = (int)atts.Width; this.m_PenHeight = (int)atts.Height; this.m_HLRasterOperation = RasterOperation.MaskPen; this.m_HLTip = PenTip.Ball; this.m_HLColor = Color.Pink.ToArgb(); this.m_HLWidth = (int)(6 * atts.Width); this.m_HLHeight = (int)(2 * atts.Width); }
public UndoChangesButton(PenPropertiesPage owner, Point location, Size size, int tabIndex) { this.DefaultWidth = owner.DrawingAttributes.Width; this.DefaultHeight = owner.DrawingAttributes.Height; this.DefaultColor = owner.DrawingAttributes.Color; this.DefaultPenTip = owner.DrawingAttributes.PenTip; this.DefaultTransparency = owner.DrawingAttributes.Transparency; this.DefaultRasterOperation = owner.DrawingAttributes.RasterOperation; this.SuspendLayout(); this.Owner = owner; owner.DrawingAttributesChanged += new EventHandler(this.OnDrawingAttributesChanged); this.FlatStyle = FlatStyle.System; this.Font = ViewerStateModel.StringFont; this.Location = location; this.Size = size; this.TabIndex = tabIndex; this.Name = "UndoChangesButton"; this.Text = Strings.UndoChanges; this.Enabled = true; this.ResumeLayout(); }
public static extern bool BitBlt(DeviceContextSafeHandle hdc, int x, int y, int cx, int cy, IntPtr hdcSrc, int x1, int y1, RasterOperation rop);
/// <summary> /// The MaskBlt function combines the color data for the source and /// destination bitmaps using the specified mask and raster operation /// </summary> /// <param name="hdcDest">Handle to the destination device context</param> /// <param name="xDest">Specifies the x-coordinate, in logical units, of the /// upper-left corner of the destination rectangle</param> /// <param name="yDest">Specifies the y-coordinate, in logical units, of the /// upper-left corner of the destination rectangle</param> /// <param name="width">Specifies the width, in logical units, of the /// destination rectangle and source bitmap</param> /// <param name="height">Specifies the height, in logical units, of the destination rectangle and source bitmap</param> /// <param name="hdcSrc">Handle to the device context from which the bitmap is to be copied. It must be zero if the dwRop parameter /// specifies a raster operation that does not include a source</param> /// <param name="xSrc">Specifies the x-coordinate, in logical units, of the upper-left corner of the source bitmap</param> /// <param name="ySrc">Specifies the y-coordinate, in logical units, of the upper-left corner of the source bitmap</param> /// <param name="hbmMask">Handle to the monochrome mask bitmap combined with the color bitmap in the source device context</param> /// <param name="xMask">Specifies the horizontal pixel offset for the mask bitmap specified by the hbmMask parameter</param> /// <param name="yMask">Specifies the vertical pixel offset for the mask bitmap specified by the hbmMask parameter</param> /// <param name="rop">Specifies both foreground and background ternary raster operation codes (ROPs) that the function uses to /// control the combination of source and destination data. The background raster operation code is stored in the high-order byte /// of the high-order word of this value; the foreground raster operation code is stored in the low-order byte of the high-order word /// of this value; the low-order word of this value is ignored, and should be zero</param> /// <returns>If the function succeeds, the return value is true, else false</returns> public static bool MaskBlt([In] IntPtr hdcDest, int xDest, int yDest, int width, int height, [In] IntPtr hdcSrc, int xSrc, int ySrc, [In] IntPtr hbmMask, int xMask, int yMask, RasterOperation rop) { return Native.MaskBlt(hdcDest, xDest, yDest, width, height, hdcSrc, xSrc, ySrc, hbmMask, xMask, yMask, rop); }
/// <summary> /// The StretchBlt function copies a bitmap from a source rectangle into a destination rectangle, stretching or /// compressing the bitmap to fit the dimensions of the destination rectangle, if necessary. The system stretches /// or compresses the bitmap according to the stretching mode currently set in the destination device context. /// </summary> /// <param name="hdcDest">Handle to the destination device context</param> /// <param name="xDest">Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle</param> /// <param name="yDest">Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle</param> /// <param name="wDest">Specifies the width, in logical units, of the destination rectangle</param> /// <param name="hDest">Specifies the height, in logical units, of the destination rectangle</param> /// <param name="hdcSrc">Handle to the source device context</param> /// <param name="xSrc">Specifies the x-coordinate, in logical units, of the upper-left corner of the source rectangle</param> /// <param name="ySrc">Specifies the y-coordinate, in logical units, of the upper-left corner of the source rectangle</param> /// <param name="wSrc">Specifies the width, in logical units, of the source rectangle</param> /// <param name="hSrc">Specifies the height, in logical units, of the source rectangle</param> /// <param name="rop">Specifies the raster operation to be performed. Raster operation codes define how the system combines colors in /// output operations that involve a brush, a source bitmap, and a destination bitmap</param> /// <returns>If the function succeeds, the return value is nonzero, otherwise zero</returns> public static bool StretchBlt([In] IntPtr hdcDest, int xDest, int yDest, int wDest, int hDest, [In] IntPtr hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc, RasterOperation rop) { return Native.StretchBlt(hdcDest, xDest, yDest, wDest, hDest, hdcSrc, xSrc, ySrc, wSrc, hSrc, rop); }
public static extern bool StretchBlt( IntPtr hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, IntPtr hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, RasterOperation dwRop );
public DrawingAttributesSerializer( SerializedPacket p ) { this.AntiAliased = SerializedPacket.DeserializeBool( p.GetNextPart() ); this.Color = SerializedPacket.DeserializeColor( p.GetNextPart() ); this.ExtendedProperties = new ArrayList(); this.FitToCurve = SerializedPacket.DeserializeBool( p.GetNextPart() ); this.Height = SerializedPacket.DeserializeFloat( p.GetNextPart() ); this.IgnorePressure = SerializedPacket.DeserializeBool( p.GetNextPart() ); this.PenTip = (PenTip)SerializedPacket.DeserializeLong( p.GetNextPart() ); this.RasterOperation = (RasterOperation)SerializedPacket.DeserializeLong( p.GetNextPart() ); this.Transparency = SerializedPacket.DeserializeByte( p.GetNextPart() ); this.Width = SerializedPacket.DeserializeFloat( p.GetNextPart() ); }
public static extern bool MaskBlt([In] IntPtr hdcDest, int xDest, int yDest, int width, int height, [In] IntPtr hdcSrc, int xSrc, int ySrc, [In] IntPtr hbmMask, int xMask, int yMask, RasterOperation rop);
public BOOL StretchBlt(int x, int y, int width, int height, HDc source, int srcX, int srcY, int srcWidth, int srcHeight, RasterOperation blend) { return(Gdi.StretchBlt(this, x, y, width, height, source, srcX, srcY, srcWidth, srcHeight, blend)); }
static extern int BitBlt(IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, RasterOperation rasterOperation);
public void UpdateValues(object model) { // Make sure both objects exist and aren't the same if (model != null && model is PenStateModel && model != this) { PenStateModel m = (PenStateModel)model; using (Synchronizer.Lock(this.SyncRoot)) { using (Synchronizer.Lock(m.SyncRoot)) { if (this.m_PenRasterOperation != m.m_PenRasterOperation) this.m_PenRasterOperation = m.m_PenRasterOperation; if (this.m_PenTip != m.m_PenTip) this.m_PenTip = m.m_PenTip; if (this.m_PenColor != m.m_PenColor) this.m_PenColor = m.m_PenColor; if (this.m_PenWidth != m.m_PenWidth) this.m_PenWidth = m.m_PenWidth; if (this.m_PenHeight != m.m_PenHeight) this.m_PenHeight = m.m_PenHeight; if (this.m_HLRasterOperation != m.m_HLRasterOperation) this.m_HLRasterOperation = m.m_HLRasterOperation; if (this.m_HLTip != m.m_HLTip) this.m_HLTip = m.m_HLTip; if (this.m_HLColor != m.m_HLColor) this.m_HLColor = m.m_HLColor; if (this.m_HLWidth != m.m_HLWidth) this.m_HLWidth = m.m_HLWidth; if (this.m_HLHeight != m.m_HLHeight) this.m_HLHeight = m.m_HLHeight; } } } }
public static extern bool StretchBlt([In] IntPtr hdcDest, int xDest, int yDest, int wDest, int hDest, [In] IntPtr hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc, RasterOperation rop);
public static extern bool PatBlt([In] IntPtr hdc, int x, int y, int w, int h, RasterOperation rop);
/// <summary> /// The PatBlt function paints the specified rectangle using the brush that is currently /// selected into the specified device context. The brush color and the surface color or /// colors are combined by using the specified raster operation /// </summary> /// <param name="hdc">Handle to the device context</param> /// <param name="x">Specifies the x-coordinate, in logical units, of the upper-left corner of the rectangle to be filled</param> /// <param name="y">Specifies the y-coordinate, in logical units, of the upper-left corner of the rectangle to be filled</param> /// <param name="w">Specifies the width, in logical units, of the rectangle</param> /// <param name="h">Specifies the height, in logical units, of the rectangle</param> /// <param name="rop">Specifies the raster operation code. This code can be one of the following values /// PATCOPY /// PATINVERT /// DSTINVERT /// BLACKNESS /// WHITENESS /// </param> /// <returns>If the function succeeds, the return value is true, otherwise false</returns> public static bool PatBlt(IntPtr hdc, int x, int y, int w, int h, RasterOperation rop) { return Native.PatBlt(hdc, x, y, w, h, rop); }
public BOOL BitBlt(int x, int y, int width, int height, HDc source, int srcX, int srcY, RasterOperation blend) { return(Gdi.BitBlt(this, x, y, width, height, source, srcX, srcY, blend)); }
/// <summary> /// The PatBlt function paints the specified rectangle using the brush that is currently /// selected into the specified device context. The brush color and the surface color or /// colors are combined by using the specified raster operation /// </summary> /// <param name="hdc">Handle to the device context</param> /// <param name="x">Specifies the x-coordinate, in logical units, of the upper-left corner of the rectangle to be filled</param> /// <param name="y">Specifies the y-coordinate, in logical units, of the upper-left corner of the rectangle to be filled</param> /// <param name="w">Specifies the width, in logical units, of the rectangle</param> /// <param name="h">Specifies the height, in logical units, of the rectangle</param> /// <param name="rop">Specifies the raster operation code. This code can be one of the following values /// PATCOPY /// PATINVERT /// DSTINVERT /// BLACKNESS /// WHITENESS /// </param> /// <returns>If the function succeeds, the return value is true, otherwise false</returns> public static bool PatBlt(IntPtr hdc, int x, int y, int w, int h, RasterOperation rop) { return(Native.PatBlt(hdc, x, y, w, h, rop)); }
public static extern bool BitBlt([In] IntPtr hdc, int x, int y, int cx, int cy, [In] IntPtr hdcSrc, int x1, int y1, RasterOperation rop);
public BOOL StretchBlt(RECT destRect, HDc source, RECT srcRect, RasterOperation blend) { System.Drawing.Rectangle d = destRect; System.Drawing.Rectangle s = destRect; return(StretchBlt(d.X, d.Y, d.Width, d.Height, source, s.X, s.Y, s.Width, s.Height, blend)); }
/// <summary> /// The StretchBlt function copies a bitmap from a source rectangle into a destination rectangle, stretching or /// compressing the bitmap to fit the dimensions of the destination rectangle, if necessary. The system stretches /// or compresses the bitmap according to the stretching mode currently set in the destination device context. /// </summary> /// <param name="hdcDest">Handle to the destination device context</param> /// <param name="xDest">Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle</param> /// <param name="yDest">Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle</param> /// <param name="wDest">Specifies the width, in logical units, of the destination rectangle</param> /// <param name="hDest">Specifies the height, in logical units, of the destination rectangle</param> /// <param name="hdcSrc">Handle to the source device context</param> /// <param name="xSrc">Specifies the x-coordinate, in logical units, of the upper-left corner of the source rectangle</param> /// <param name="ySrc">Specifies the y-coordinate, in logical units, of the upper-left corner of the source rectangle</param> /// <param name="wSrc">Specifies the width, in logical units, of the source rectangle</param> /// <param name="hSrc">Specifies the height, in logical units, of the source rectangle</param> /// <param name="rop">Specifies the raster operation to be performed. Raster operation codes define how the system combines colors in /// output operations that involve a brush, a source bitmap, and a destination bitmap</param> /// <returns>If the function succeeds, the return value is nonzero, otherwise zero</returns> public static bool StretchBlt([In] IntPtr hdcDest, int xDest, int yDest, int wDest, int hDest, [In] IntPtr hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc, RasterOperation rop) { return(Native.StretchBlt(hdcDest, xDest, yDest, wDest, hDest, hdcSrc, xSrc, ySrc, wSrc, hSrc, rop)); }
public BOOL BitBlt(RECT destRect, HDc source, int srcX, int srcY, RasterOperation blend) { System.Drawing.Rectangle r = destRect; return(BitBlt(r.X, r.Y, r.Width, r.Height, source, srcX, srcY, blend)); }
/// <summary> /// The MaskBlt function combines the color data for the source and /// destination bitmaps using the specified mask and raster operation /// </summary> /// <param name="hdcDest">Handle to the destination device context</param> /// <param name="xDest">Specifies the x-coordinate, in logical units, of the /// upper-left corner of the destination rectangle</param> /// <param name="yDest">Specifies the y-coordinate, in logical units, of the /// upper-left corner of the destination rectangle</param> /// <param name="width">Specifies the width, in logical units, of the /// destination rectangle and source bitmap</param> /// <param name="height">Specifies the height, in logical units, of the destination rectangle and source bitmap</param> /// <param name="hdcSrc">Handle to the device context from which the bitmap is to be copied. It must be zero if the dwRop parameter /// specifies a raster operation that does not include a source</param> /// <param name="xSrc">Specifies the x-coordinate, in logical units, of the upper-left corner of the source bitmap</param> /// <param name="ySrc">Specifies the y-coordinate, in logical units, of the upper-left corner of the source bitmap</param> /// <param name="hbmMask">Handle to the monochrome mask bitmap combined with the color bitmap in the source device context</param> /// <param name="xMask">Specifies the horizontal pixel offset for the mask bitmap specified by the hbmMask parameter</param> /// <param name="yMask">Specifies the vertical pixel offset for the mask bitmap specified by the hbmMask parameter</param> /// <param name="rop">Specifies both foreground and background ternary raster operation codes (ROPs) that the function uses to /// control the combination of source and destination data. The background raster operation code is stored in the high-order byte /// of the high-order word of this value; the foreground raster operation code is stored in the low-order byte of the high-order word /// of this value; the low-order word of this value is ignored, and should be zero</param> /// <returns>If the function succeeds, the return value is true, else false</returns> public static bool MaskBlt([In] IntPtr hdcDest, int xDest, int yDest, int width, int height, [In] IntPtr hdcSrc, int xSrc, int ySrc, [In] IntPtr hbmMask, int xMask, int yMask, RasterOperation rop) { return(Native.MaskBlt(hdcDest, xDest, yDest, width, height, hdcSrc, xSrc, ySrc, hbmMask, xMask, yMask, rop)); }
private static extern int BitBlt(IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, RasterOperation rasterOperation);
public static extern bool BitBlt( IntPtr hdc, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, RasterOperation dwRop );
/// <summary> /// The BitBlt function performs a bit-block transfer of the color data corresponding to a /// rectangle of pixels from the specified source device context into a destination device context. /// </summary> /// <param name="hdc">Handle to the destination device context.</param> /// <param name="x">Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle</param> /// <param name="y">Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle</param> /// <param name="cx">Specifies the width, in logical units, of the source and destination rectangles</param> /// <param name="cy">Specifies the height, in logical units, of the source and the destination rectangles</param> /// <param name="hdcSrc">Handle to the source device context</param> /// <param name="x1">Specifies the x-coordinate, in logical units, of the upper-left corner of the source rectangle</param> /// <param name="y1">Specifies the y-coordinate, in logical units, of the upper-left corner of the source rectangle</param> /// <param name="rop">Specifies a raster-operation code. These codes define how the color data for the source rectangle /// is to be combined with the color data for the destination rectangle to achieve the final color</param> /// <returns>If the function succeeds, the return value is true. /// If the function fails, the return value is false.</returns> public static bool BitBlt(IntPtr hdc, int x, int y, int cx, int cy, IntPtr hdcSrc, int x1, int y1, RasterOperation rop) { return(Native.BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, rop)); }
/// <summary> /// The BitBlt function performs a bit-block transfer of the color data corresponding to a /// rectangle of pixels from the specified source device context into a destination device context. /// </summary> /// <param name="hdc">Handle to the destination device context.</param> /// <param name="x">Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle</param> /// <param name="y">Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle</param> /// <param name="cx">Specifies the width, in logical units, of the source and destination rectangles</param> /// <param name="cy">Specifies the height, in logical units, of the source and the destination rectangles</param> /// <param name="hdcSrc">Handle to the source device context</param> /// <param name="x1">Specifies the x-coordinate, in logical units, of the upper-left corner of the source rectangle</param> /// <param name="y1">Specifies the y-coordinate, in logical units, of the upper-left corner of the source rectangle</param> /// <param name="rop">Specifies a raster-operation code. These codes define how the color data for the source rectangle /// is to be combined with the color data for the destination rectangle to achieve the final color</param> /// <returns>If the function succeeds, the return value is true. /// If the function fails, the return value is false.</returns> public static bool BitBlt(IntPtr hdc, int x, int y, int cx, int cy, IntPtr hdcSrc, int x1, int y1, RasterOperation rop) { return Native.BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, rop); }