/** * Sets the scaling height for the image.<p> * * If no valid integer is given, then "0" is used as value.<p> * * @param value the scaling height for the image to set */ public void setHeight(String value) { m_scaler.setHeight(CmsStringUtil.getIntValueRounded(value, 0, SCALE_ATTR_HEIGHT)); }
/** * Sets the scaling height for the image.<p> * * If no valid integer is given, then "0" is used as value.<p> * * @param value the scaling height for the image to set */ public void setHeight(String value) { m_scaler.setHeight(CmsStringUtil.getIntValue(value, 0, SCALE_ATTR_HEIGHT)); }
/** * Creates a new image scaler based on the given base scaler and the given width and height.<p> * * @param base the base scaler to initialize the values with * @param width the width to set for this scaler * @param height the height to set for this scaler */ protected CmsImageScaler(CmsImageScaler base, int width, int height) { initValuesFrom(base); setWidth(width); setHeight(height); }
/** * Creates a new image scaler based on the given base scaler and the given width and height.<p> * * @param base the base scaler to initialize the values with * @param width the width to set for this scaler * @param height the height to set for this scaler */ protected CmsImageScaler(CmsImageScaler base, int width, int height) { initValuesFrom(base); setWidth(width); setHeight(height); }
/** * Sets the image size for thumbnails and the detail view.<p> * * @param configValue the String value of the configuration file * @param isThumbNail flag indicating if the thumbnail or the detail view configuration is set * @throws Exception if parsing the configuration fails */ private void setImageSize(String configValue, boolean isThumbNail) throws Exception { List sizes = CmsStringUtil.splitAsList(getConfigurationValue(configValue, "200x150"), 'x', true); int width = Integer.parseInt((String)sizes.get(0)); int height = Integer.parseInt((String)sizes.get(1)); if (isThumbNail) { getThumbNailScaler().setWidth(width); getThumbNailScaler().setHeight(height); } else { getDetailImageScaler().setWidth(width); getDetailImageScaler().setHeight(height); } }
/** * Returns the initialized image scaler object used to generate thumbnails for the dialog form.<p> * * @return the initialized image scaler object used to generate thumbnails for the dialog form */ protected CmsImageScaler getImageScaler() { if (m_imageScaler == null) { // not initialized, create image scaler with default settings m_imageScaler = new CmsImageScaler(); m_imageScaler.setWidth(THUMB_WIDTH); m_imageScaler.setHeight(THUMB_HEIGHT); m_imageScaler.setRenderMode(Simapi.RENDER_SPEED); m_imageScaler.setColor(new Color(0, 0, 0)); m_imageScaler.setType(1); } return m_imageScaler; }
/** * Returns the initialized image scaler object used to generate thumbnails for the dialog form.<p> * * @return the initialized image scaler object used to generate thumbnails for the dialog form */ protected CmsImageScaler getImageScaler() { if (m_imageScaler == null) { // not initialized, create image scaler with default settings m_imageScaler = new CmsImageScaler(); m_imageScaler.setWidth(THUMB_WIDTH); m_imageScaler.setHeight(THUMB_HEIGHT); m_imageScaler.setRenderMode(Simapi.RENDER_SPEED); m_imageScaler.setColor(new Color(0, 0, 0)); m_imageScaler.setType(1); } return m_imageScaler; }
scaler.setHeight(downScaler.getHeight()); scaler.setWidth(downScaler.getWidth());
scaler.setHeight(downScaler.getHeight()); scaler.setWidth(downScaler.getWidth());
scaler.setHeight(60);
CmsImageScaler hiDpiScaler = (CmsImageScaler)scaler.clone(); hiDpiScaler.setWidth(width); hiDpiScaler.setHeight(height);
m_defaultScaleParams.setPosition(0); m_defaultScaleParams.setWidth(120); m_defaultScaleParams.setHeight(90); m_defaultScaleParams.setColor(new Color(221, 221, 221));
m_defaultScaleParams.setPosition(0); m_defaultScaleParams.setWidth(120); m_defaultScaleParams.setHeight(90); m_defaultScaleParams.setColor(new Color(221, 221, 221));
cropScaler.setHeight(cropScaler.getCropHeight());
scaler.setHeight(192); scaler.setWidth(192); byte[] content = scaler.scaleImage(tempFile);