Package com.sun.jna.examples.unix

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


            final Pixmap pm = x11.XCreatePixmap(dpy, win, width, height, 1);
            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);
View Full Code Here


                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) {
                return null;
            }
View Full Code Here

                g.drawImage(image, 0, 0, w, h, null);
               
                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++) {
View Full Code Here

                            raster.getPixel(x, h-y-1, pixel);
                            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);
                }
View Full Code Here

            final Pixmap pm = x11.XCreatePixmap(dpy, win, width, height, 1);
            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) {
View Full Code Here

                    p.setShort(6, (short)r.height);
                    rects[i].setAutoSynch(false);
                    // End optimization
                }
                final int UNMASKED = 1;
                x11.XSetForeground(dpy, gc, new NativeLong(UNMASKED));
                x11.XFillRectangles(dpy, pm, gc, rects, rects.length);
            }
            finally {
                x11.XFreeGC(dpy, gc);
            }
View Full Code Here

            final Pixmap pm = x11.XCreatePixmap(dpy, win, width, height, 1);
            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) {
View Full Code Here

                    p.setShort(6, (short)r.height);
                    rects[i].setAutoSynch(false);
                    // End optimization
                }
                final int UNMASKED = 1;
                x11.XSetForeground(dpy, gc, new NativeLong(UNMASKED));
                x11.XFillRectangles(dpy, pm, gc, rects, rects.length);
            }
            finally {
                x11.XFreeGC(dpy, gc);
            }
View Full Code Here

      final Pixmap pm = x11.XCreatePixmap(dpy, win, width, height, 1);
      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);
View Full Code Here

        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) {
        return null;
      }
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.