public void setDimensions(int w, int h) {
        if(width < 0) {
            width = w - X;
        }
        if(height < 0) {
            height = h - Y;
        }

        grabberStatus |= ImageObserver.WIDTH | ImageObserver.HEIGHT;

        if(width <=0 || height <=0){
            imageComplete(STATICIMAGEDONE);
            return;
        }

        if(isRGB && dataType == DATA_TYPE_UNDEFINED){
            iData = new int[width * height];
            dataType = DATA_TYPE_INT;
            scanline = width;
        }
    }