Package com.sun.jna.examples.unix

Examples of com.sun.jna.examples.unix.X11.XFillRectangle()


            final GC gc = x11.XCreateGC(dpy, pm, new NativeLong(0), null);
            if (gc == null) {
                return null;
            }
            x11.XSetForeground(dpy, gc, new NativeLong(0));
            x11.XFillRectangle(dpy, pm, gc, 0, 0, width, height);
            final int UNMASKED = 1;
            x11.XSetForeground(dpy, gc, new NativeLong(UNMASKED));
            X11.XWindowAttributes atts = new X11.XWindowAttributes();
            int status = x11.XGetWindowAttributes(dpy, win, atts);
            if (status == 0) {
View Full Code Here


                return null;
            }
            try {
                RasterRangesUtils.outputOccupiedRanges(raster, new RasterRangesUtils.RangesOutput() {
                    public boolean outputRange(int x, int y, int w, int h) {
                        return x11.XFillRectangle(dpy, pm, gc, x, y, w, h) != 0;
                    }
                });
            }
            finally {
                x11.XFreeGC(dpy, gc);
View Full Code Here

               
                GC gc = x11.XCreateGC(dpy, win, new NativeLong(0), null);
                Pixmap pixmap = x11.XCreatePixmap(dpy, win, w, h, 32);
                try {
                    x11.XSetForeground(dpy, gc, new NativeLong(0));
                    x11.XFillRectangle(dpy, pixmap, gc, 0, 0, w, h);
                    Raster raster = buf.getData();
                    int[] pixel = new int[4];
                    for (int y=0;y < h;y++) {
                        for (int x=0;x < w;x++) {
                            raster.getPixel(x, h-y-1, pixel);
View Full Code Here

                            int alpha = (pixel[3]&0xFF)<<24;
                            int red = (pixel[2]&0xFF);
                            int green = (pixel[1]&0xFF)<<8;
                            int blue = (pixel[0]&0xFF)<<16;
                            x11.XSetForeground(dpy, gc, new NativeLong(alpha|red|green|blue));
                            x11.XFillRectangle(dpy, pixmap, gc, x, h-y-1, 1, 1);
                        }
                    }
                    x11.XCopyArea(dpy, pixmap, win, gc, 0, 0, w, h, 0, 0);
                }
                finally {
View Full Code Here

            final GC gc = x11.XCreateGC(dpy, pm, new NativeLong(0), null);
            if (gc == null) {
                return null;
            }
            x11.XSetForeground(dpy, gc, new NativeLong(0));
            x11.XFillRectangle(dpy, pm, gc, 0, 0, width, height);
            final List rlist = new ArrayList();
            try {
                RasterRangesUtils.outputOccupiedRanges(raster, new RasterRangesUtils.RangesOutput() {
                    public boolean outputRange(int x, int y, int w, int h) {
                        rlist.add(new Rectangle(x, y, w, h));
View Full Code Here

            final GC gc = x11.XCreateGC(dpy, pm, new NativeLong(0), null);
            if (gc == null) {
                return null;
            }
            x11.XSetForeground(dpy, gc, new NativeLong(0));
            x11.XFillRectangle(dpy, pm, gc, 0, 0, width, height);
            final List rlist = new ArrayList();
            try {
                RasterRangesUtils.outputOccupiedRanges(raster, new RasterRangesUtils.RangesOutput() {
                    public boolean outputRange(int x, int y, int w, int h) {
                        rlist.add(new Rectangle(x, y, w, h));
View Full Code Here

      final GC gc = x11.XCreateGC(dpy, pm, new NativeLong(0), null);
      if (gc == null) {
        return null;
      }
      x11.XSetForeground(dpy, gc, new NativeLong(0));
      x11.XFillRectangle(dpy, pm, gc, 0, 0, width, height);
      final int UNMASKED = 1;
      x11.XSetForeground(dpy, gc, new NativeLong(UNMASKED));
      X11.XWindowAttributes atts = new X11.XWindowAttributes();
      int status = x11.XGetWindowAttributes(dpy, win, atts);
      if (status == 0) {
View Full Code Here

        return null;
      }
      try {
        for (int i = 0; i < rectangles.length; i++) {
          Rectangle rect = rectangles[i];
          x11.XFillRectangle(dpy, pm, gc, rect.x, rect.y, rect.width,
              rect.height);
        }
      } finally {
        x11.XFreeGC(dpy, gc);
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.