Exemple #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);
 }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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));
        }
Exemple #5
0
 public void Dispose()
 {
     NativePixelLibInterOp.CallServerService(nativeCanvasPtr, ServerServiceName.Shutdown);
 }
Exemple #6
0
 public void Render()
 {
     //render content to viewport
     NativePixelLibInterOp.CallServerService(nativeCanvasPtr, ServerServiceName.RefreshScreen);
 }
Exemple #7
0
 public void DrawLine(double x1, double y1, double x2, double y2)
 {
     NativePixelLibInterOp.drawLine(this.nativeCanvasPtr,
                                    x1, y1, x2, y2);
 }
Exemple #8
0
 public void SetBrushColor(Color c)
 {
     NativePixelLibInterOp.setBrushColor(this.nativeCanvasPtr,
                                         c.R, c.B, c.B, c.A);
 }
Exemple #9
0
 public void SetLineWidth(double lineWidth)
 {
     NativePixelLibInterOp.setLineWidth(this.nativeCanvasPtr, lineWidth);
 }
Exemple #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);
 }
Exemple #11
0
 public void DrawImage(NativeBmp bmp, int x, int y)
 {
     NativePixelLibInterOp.DrawImage(
         this.nativeCanvasPtr, bmp,
         x, y, bmp.Width, this.h - bmp.Height);
 }
Exemple #12
0
 public void ClearBackground()
 {
     NativePixelLibInterOp.CallServerService(nativeCanvasPtr, ServerServiceName.Draw4);
 }