示例#1
0
	public override void OnSetDestinationPixelBuffer()
	{
        if (null == DestinationPixelBuffer)
            return;

        bitmapBuffer = (GDIDIBSection)this.DestinationPixelBuffer.Clone();
        bitmapGraphics = bitmapBuffer.GraphPort;
        bitmapBuffer.DeviceContext.ClearToWhite();
	}
示例#2
0
	public GearBox(string name, int x, int y, int width, int height)
		: base(name, x, y, width, height)
	{
        fBacking = new GDIDIBSection(Convert.ToInt32(width * 96), Convert.ToInt32(height * 96));
        fGraphPort = fBacking.GraphPort;
		//fGraphPort.PageUnit = GraphicsUnit.Inch;

		AddImages();
	}
示例#3
0
        //public virtual void AlphaBlend(int x, int y, int width, int height,
        //            IPixelArray pixArray, int srcX, int srcY, int srcWidth, int srcHeight,
        //            byte alpha)
        public virtual void AlphaBlend(int x, int y, int width, int height,
                    GDIPixmap srchDC, int srcX, int srcY, int srcWidth, int srcHeight,
                    byte alpha)
        {
            // The boundary rectangle is specified by the user
            //Rectangle srcBoundary = new Rectangle(srcX, srcY, srcWidth, srcHeight);

            //// Create the destination rectangle
            //Rectangle dstRect = new Rectangle(x, y, width, height);

            //// Create the intersection of the dstRect and the srcRect
            ////srcRect.Intersect(dstRect);

            //// If there is no intersection, then just return
            ////if (srcRect.IsEmpty)
            ////    return;

            //PixmapShardBlend(pixArray, srcBoundary, dstRect, alpha / 255.0f);
        }
示例#4
0
 public virtual void DrawImage(GDIPixmap bitmap, System.Drawing.Point[] destinationParallelogram,
     System.Drawing.Rectangle srcRect,
     System.Drawing.GraphicsUnit units)
 {
 }
示例#5
0
 public virtual void ScaleBitmap(GDIPixmap aBitmap, Rectangle aFrame)
 {
 }
示例#6
0
        public virtual void DrawImage(GDIPixmap bitmap,
            System.Drawing.Point[] destinationParallelogram,
            System.Drawing.Rectangle srcRect,
            System.Drawing.GraphicsUnit units)
        {
            TOAPI.Types.POINT[] pts = new POINT[destinationParallelogram.Length];
            for (int i = 0; i < pts.Length; i++)
            {
                pts[i].X = destinationParallelogram[i].X;
                pts[i].Y = destinationParallelogram[i].Y;
            }

            bool result = DeviceContext.PlgBlt(bitmap.DeviceContext, srcRect, pts,
                IntPtr.Zero, 0, 0);
        }
示例#7
0
        public virtual void AlphaBlend(int x, int y, int width, int height,
                    GDIPixmap bitmap, int srcX, int srcY, int srcWidth, int srcHeight,
                    byte opacity)
        {
            // If no bitmap, fail silently
            if (null == bitmap)
                return;

            bool result = DeviceContext.AlphaBlend(bitmap.DeviceContext, new Rectangle(srcX, srcY, srcWidth, srcHeight),
                new Rectangle(x, y, width, height), opacity);
        }
示例#8
0
        public virtual void ScaleBitmap(GDIPixmap bitmap, Rectangle aFrame)
        {
            // If no bitmap, fail silently
            if (null == bitmap)
                return;

            bool result = DeviceContext.AlphaBlend(bitmap.DeviceContext, new Rectangle(0, 0, bitmap.Width, bitmap.Height),
                aFrame, 255);
        }
示例#9
0
        public virtual void DrawBitmap(GDIPixmap pixmap, System.Drawing.Rectangle srcRect, System.Drawing.Rectangle dstRect)
        {
            // If no bitmap, fail silently
            if (null == pixmap)
                return;

            bool result = DeviceContext.AlphaBlend(pixmap.DeviceContext, srcRect, dstRect, 255);
        }
示例#10
0
        /// <summary>
        /// DrawImage, will draw the supplied image graphic on the screen.  It will use
        /// the Image's frame and size to determine where to display it.
        /// </summary>
        /// <param name="img"></param>
        public virtual void DrawBitmap(GDIPixmap pixmap, Point origin)
        {
            // If no bitmap, fail silently
            if (null == pixmap)
                return;

            bool result = DeviceContext.AlphaBlend(pixmap.DeviceContext,
                new Rectangle(0, 0, pixmap.Width, pixmap.Height), 
                new Rectangle(origin.X, origin.Y, pixmap.Width, pixmap.Height), 
                255);
        }
示例#11
0
 public virtual void AlphaBlend(int x, int y, int width, int height,
             GDIPixmap bitmap, int srcX, int srcY, int srcWidth, int srcHeight,
             byte alpha)
 {
 }
示例#12
0
 public virtual void DrawImage(GDIPixmap bitmap, Point[] destinationParallelogram, Rectangle srcRect, GraphicsUnit units)
 {
 }