Package com.sun.jna.examples.win32.WinDef

Examples of com.sun.jna.examples.win32.WinDef.HRGN


            List sizes = new ArrayList();
            while (!pi.isDone()) {
                int type = pi.currentSegment(coords);
                if (type == PathIterator.SEG_MOVETO) {
                    size = 1;
                    points.add(new POINT((int)coords[0], (int)coords[1]));
                }
                else if (type == PathIterator.SEG_LINETO) {
                    ++size;
                    points.add(new POINT((int)coords[0], (int)coords[1]));
                }
                else if (type == PathIterator.SEG_CLOSE) {
                    sizes.add(new Integer(size));
                }
                else {
                    throw new RuntimeException("Area is not polygonal: " + area);
                }
                pi.next();
            }
            POINT[] lppt = (POINT[])new POINT().toArray(points.size());
            POINT[] pts = (POINT[])points.toArray(new POINT[points.size()]);
            for (int i=0;i < lppt.length;i++) {
                lppt[i].x = pts[i].x;
                lppt[i].y = pts[i].y;
            }
View Full Code Here


    public byte[] getData() {
      return _data;
    }

    public EventLogRecord(Pointer pevlr) {
      _record = new EVENTLOGRECORD(pevlr);
      _source = pevlr.getWideString(_record.size());
      // data
      if (_record.DataLength.intValue() > 0) {
        _data = pevlr.getByteArray(_record.DataOffset.intValue(),
            _record.DataLength.intValue());
View Full Code Here

        File f = new File(fileName);
        if (!f.exists()) {
            throw new FileNotFoundException(fileName);
        }

        HANDLE hFile = null;
        try {
            hFile = Kernel32.INSTANCE.CreateFile(fileName, WinNT.GENERIC_READ,
                    WinNT.FILE_SHARE_READ, new WinBase.SECURITY_ATTRIBUTES(),
                    WinNT.OPEN_EXISTING, WinNT.FILE_ATTRIBUTE_NORMAL,
                    new HANDLEByReference().getValue());
View Full Code Here

        HANDLE hFile = null;
        try {
            hFile = Kernel32.INSTANCE.CreateFile(fileName, WinNT.GENERIC_READ,
                    WinNT.FILE_SHARE_READ, new WinBase.SECURITY_ATTRIBUTES(),
                    WinNT.OPEN_EXISTING, WinNT.FILE_ATTRIBUTE_NORMAL,
                    new HANDLEByReference().getValue());

            if (WinBase.INVALID_HANDLE_VALUE.equals(hFile)) {
                throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
            }
View Full Code Here

   *            original w32 error code
   * @return the converted value
   */
  public static final HRESULT HRESULT_FROM_WIN32(int x) {
    int f = FACILITY_WIN32;
    return new HRESULT(x <= 0 ? x : ((x) & 0x0000FFFF) | (f <<= 16)
        | 0x80000000);
  }
View Full Code Here

                    int flags = user.GetWindowLong(hWnd, User32.GWL_EXSTYLE);
                    byte level = (byte)((int)(255 * alpha) & 0xFF);
                    if (usingUpdateLayeredWindow(w)) {
                        // If already using UpdateLayeredWindow, continue to
                        // do so
                        BLENDFUNCTION blend = new BLENDFUNCTION();
                        blend.SourceConstantAlpha = level;
                        blend.AlphaFormat = User32.AC_SRC_ALPHA;
                        user.UpdateLayeredWindow(hWnd, null, null, null, null,
                                                 null, 0, blend,
                                                 User32.ULW_ALPHA);
View Full Code Here

            }
            int[] counts = new int[sizes.size()];
            for (int i=0;i < counts.length;i++) {
                counts[i] = sizes.get(i).intValue();
            }
            HRGN hrgn = gdi.CreatePolyPolygonRgn(lppt, counts, counts.length, mode);
            setWindowRegion(w, hrgn);
        }
View Full Code Here

            setWindowRegion(w, hrgn);
        }

        protected void setMask(final Component w, final Raster raster) {
            GDI32 gdi = GDI32.INSTANCE;
            final HRGN region = raster != null
                ? gdi.CreateRectRgn(0, 0, 0, 0) : null;
            if (region != null) {
                final HRGN tempRgn = gdi.CreateRectRgn(0, 0, 0, 0);
                try {
                    RasterRangesUtils.outputOccupiedRanges(raster, new RasterRangesUtils.RangesOutput() {
                        public boolean outputRange(int x, int y, int w, int h) {
                            GDI32 gdi = GDI32.INSTANCE;
                            gdi.SetRectRgn(tempRgn, x, y, x + w, y + h);
View Full Code Here

            }
            int[] counts = new int[sizes.size()];
            for (int i=0;i < counts.length;i++) {
                counts[i] = ((Integer)sizes.get(i)).intValue();
            }
            HRGN hrgn = gdi.CreatePolyPolygonRgn(lppt, counts, counts.length, mode);
            setWindowRegion(w, hrgn);
        }
View Full Code Here

            setWindowRegion(w, hrgn);
        }

        protected void setMask(final Component w, final Raster raster) {
            GDI32 gdi = GDI32.INSTANCE;
            final HRGN region = raster != null
                ? gdi.CreateRectRgn(0, 0, 0, 0) : null;
            if (region != null) {
                final HRGN tempRgn = gdi.CreateRectRgn(0, 0, 0, 0);
                try {
                    RasterRangesUtils.outputOccupiedRanges(raster, new RasterRangesUtils.RangesOutput() {
                        public boolean outputRange(int x, int y, int w, int h) {
                            GDI32 gdi = GDI32.INSTANCE;
                            gdi.SetRectRgn(tempRgn, x, y, x + w, y + h);
View Full Code Here

TOP

Related Classes of com.sun.jna.examples.win32.WinDef.HRGN

Copyright © 2018 www.massapicom. 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.