Package cli.System.Drawing

Examples of cli.System.Drawing.Bitmap


                Util.throwException(new NotSupportedException());
            }
           
        };
        try{
            Bitmap bitmap = new Bitmap(stream);
            int width = bitmap.get_Width();
            int height = bitmap.get_Height();
            int size = width * height;
            int[] pixelData = new int[size];
           
            cli.System.Drawing.Rectangle rect = new cli.System.Drawing.Rectangle(0, 0, width, height);
            cli.System.Drawing.Imaging.BitmapData data = bitmap.LockBits(rect, ImageLockMode.wrap(ImageLockMode.ReadOnly), PixelFormat.wrap(PixelFormat.Format32bppArgb));
            cli.System.IntPtr pixelPtr = data.get_Scan0();
            cli.System.Runtime.InteropServices.Marshal.Copy(pixelPtr, pixelData, 0, size);       
            bitmap.UnlockBits(data);
           
            //source.
           
            setDimensions(width, height);
            ColorModel cm = ColorModel.getRGBdefault();
View Full Code Here


        availinfo |= ImageObserver.WIDTH | ImageObserver.HEIGHT;
    }
   
    private Bitmap getBitmapRef(){
      if( bitmap == null ){
        bitmap = new Bitmap(width, height, PixelFormat.wrap(pixelFormat) );
      }
      return bitmap;
    }
View Full Code Here

    static Image getFileChooserIcon(int idx){
        if(fileChooserIcons == null){
            fileChooserIcons = new Image[47];

            try{
                Bitmap bitmap = getFileChooserBitmap();
                if (bitmap == null) {
                    return null;
                }
               
                for(int i = 0; i < fileChooserIcons.length; i++){
                    cli.System.Drawing.Rectangle rect = new cli.System.Drawing.Rectangle(16 * i, 0, 16, 16);
                    Bitmap icon = bitmap.Clone(rect, bitmap.get_PixelFormat());
                    fileChooserIcons[i] = new BufferedImage(icon);
                }
            }catch(Throwable ex){
                ex.printStackTrace();
            }
View Full Code Here

     */
    @cli.System.Security.SecurityCriticalAttribute.Annotation
    private static Image makeIcon(cli.System.IntPtr hIcon, boolean getLargeIcon) {
        if (hIcon != null ) {
            // Get the bits.  This has the side effect of setting the imageHash value for this object.
            Bitmap bitmap = getIconBits(hIcon, getLargeIcon ? 32 : 16 );
            if (bitmap == null) {
                return null;
            }           
            return new BufferedImage(bitmap);
        }
View Full Code Here

    /**
     * Gets an icon from the Windows system icon list as an <code>Image</code>
     */
    static Image getShell32Icon(int iconID) {
        Bitmap bitmap = getShell32IconResourceAsBitmap(iconID);
        if (bitmap == null) {
            return null;
        }
        return new BufferedImage(bitmap);
    }
View Full Code Here

TOP

Related Classes of cli.System.Drawing.Bitmap

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.