コード例 #1
0
 public void DrawImage(NativeBmp bmp, Point[] fourCorners)
 {
     NativePixelLibInterOp.drawImage2(this.nativeCanvasPtr,
                                      bmp.Handle,
                                      fourCorners[0].X, fourCorners[0].Y,
                                      fourCorners[1].X, fourCorners[1].Y,
                                      fourCorners[2].X, fourCorners[2].Y,
                                      fourCorners[3].X, fourCorners[3].Y);
 }
コード例 #2
0
        public static void DrawImage(IntPtr canvasPtr, NativeBmp nativeBmp, int x, int y, int w, int h)
        {
            int x1 = x;
            int y1 = y;
            int x2 = x1 + w;
            int y2 = y1 - h;

            //flip coord
            NativePixelLibInterOp.drawImage(canvasPtr,
                                            nativeBmp.Handle, x1, y1, x2, y2);
        }
コード例 #3
0
        public static NativeCanvas CreateNativeCanvas(IntPtr windowPtr, int w, int h)
        {
            IntPtr       ptr          = NativePixelLibInterOp.setupMainWindow(windowPtr);
            NativeCanvas nativeCanvas = new NativeCanvas(ptr);

            nativeCanvas.w = w;
            nativeCanvas.h = h;

            if (NativePixelLibInterOp.CallServerService(ptr, ServerServiceName.Init) == 0)
            {
                //ok
            }
            return(nativeCanvas);
        }
コード例 #4
0
        public static NativeBmp CreateNativeWrapper(int bmpW, int bmpH, int stride, int bpp, IntPtr pixels)
        {
            IntPtr nbmp = NativePixelLibInterOp.makeBitmapWrapper(bmpW, bmpH, stride, bpp, pixels);

            return(new NativeBmp(nbmp, bmpW, bmpH));
        }
コード例 #5
0
 public void Dispose()
 {
     NativePixelLibInterOp.CallServerService(nativeCanvasPtr, ServerServiceName.Shutdown);
 }
コード例 #6
0
 public void Render()
 {
     //render content to viewport
     NativePixelLibInterOp.CallServerService(nativeCanvasPtr, ServerServiceName.RefreshScreen);
 }
コード例 #7
0
 public void DrawLine(double x1, double y1, double x2, double y2)
 {
     NativePixelLibInterOp.drawLine(this.nativeCanvasPtr,
                                    x1, y1, x2, y2);
 }
コード例 #8
0
 public void SetBrushColor(Color c)
 {
     NativePixelLibInterOp.setBrushColor(this.nativeCanvasPtr,
                                         c.R, c.B, c.B, c.A);
 }
コード例 #9
0
 public void SetLineWidth(double lineWidth)
 {
     NativePixelLibInterOp.setLineWidth(this.nativeCanvasPtr, lineWidth);
 }
コード例 #10
0
 public void DrawImage(NativeBmp bmp, int x, int y, int w, int h)
 {
     NativePixelLibInterOp.DrawImage(
         this.nativeCanvasPtr, bmp,
         x, y, w, this.h - h);
 }
コード例 #11
0
 public void DrawImage(NativeBmp bmp, int x, int y)
 {
     NativePixelLibInterOp.DrawImage(
         this.nativeCanvasPtr, bmp,
         x, y, bmp.Width, this.h - bmp.Height);
 }
コード例 #12
0
 public void ClearBackground()
 {
     NativePixelLibInterOp.CallServerService(nativeCanvasPtr, ServerServiceName.Draw4);
 }