本文整理了Java中org.eclipse.swt.graphics.Color.getAlpha()
方法的一些代码示例,展示了Color.getAlpha()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Color.getAlpha()
方法的具体详情如下:
包路径:org.eclipse.swt.graphics.Color
类名称:Color
方法名:getAlpha
[英]Returns the amount of alpha in the color, from 0 (transparent) to 255 (opaque).
[中]返回颜色中的alpha量,从0(透明)到255(不透明)。
代码示例来源:origin: stefanhaustein/flowgrid
public void setStrokeWidth(double sw) {
strokeWidth = sw;
strokeWidthPx = Math.round(canvasControl.pixelSize(sw));
gc().setLineWidth(strokeWidthPx);
stroke = strokeWidthPx > 0 && foreground.getAlpha() != 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
String getRGBcolor(int id){
Color color = display.getSystemColor(id);
return String.format("(%d,%d,%d,%d)", color.getRed(), color.getGreen(),
color.getBlue(), color.getAlpha());
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
private void _setBackground (Color color) {
int pixel = -1;
int alpha = 255;
if (color != null) {
if (color.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
pixel = color.handle;
alpha = color.getAlpha();
}
if (pixel == background && alpha == backgroundAlpha) return;
background = pixel;
backgroundAlpha = alpha;
updateBackgroundColor ();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
/**
* Returns a string containing a concise, human-readable
* description of the receiver.
*
* @return a string representation of the receiver
*/
@Override
public String toString () {
if (isDisposed()) return "Color {*DISPOSED*}";
return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() +"}";
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* Returns a string containing a concise, human-readable
* description of the receiver.
*
* @return a string representation of the receiver
*/
@Override
public String toString () {
if (isDisposed()) return "Color {*DISPOSED*}";
return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() +"}";
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
/**
* Returns a string containing a concise, human-readable
* description of the receiver.
*
* @return a string representation of the receiver
*/
@Override
public String toString () {
if (isDisposed()) return "Color {*DISPOSED*}"; //$NON-NLS-1$
return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() + "}"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
/**
* Returns a string containing a concise, human-readable
* description of the receiver.
*
* @return a string representation of the receiver
*/
@Override
public String toString () {
if (isDisposed()) return "Color {*DISPOSED*}";
return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() +"}";
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Returns a string containing a concise, human-readable description of the
* receiver.
*
* @return a string representation of the receiver
*/
@Override
public String toString() {
if( isDisposed() ) {
return "Color {*DISPOSED*}";
}
return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + getAlpha() + "}";
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
/**
* Returns an <code>RGBA</code> representing the receiver.
*
* @return the RGBA for the color
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
* @since 3.104
*/
public RGBA getRGBA () {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
return new RGBA(getRed(), getGreen(), getBlue(), getAlpha());
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
/**
* Returns an <code>RGBA</code> representing the receiver.
*
* @return the RGBA for the color
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
* @since 3.104
*/
public RGBA getRGBA () {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
return new RGBA(getRed(), getGreen(), getBlue(), getAlpha());
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* Returns an <code>RGBA</code> representing the receiver.
*
* @return the RGBA for the color
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
* @since 3.104
*/
public RGBA getRGBA () {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
return new RGBA(getRed(), getGreen(), getBlue(), getAlpha());
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Returns an <code>RGBA</code> representing the receiver.
*
* @return the RGBA for the color
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
* @since 3.1
*/
public RGBA getRGBA() {
if( isDisposed() ) {
SWT.error( SWT.ERROR_GRAPHIC_DISPOSED );
}
return new RGBA( getRed(), getGreen(), getBlue(), getAlpha() );
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
if (color.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT);
gdkColor = color.handle;
backgroundAlpha = color.getAlpha ();
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
if (color.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT);
gdkColor = color.handle;
backgroundAlpha = color.getAlpha ();
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
if (color.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT);
gdkColor = color.handle;
backgroundAlpha = color.getAlpha ();
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
public void renderBackground( IControlAdapter controlAdapter ) {
if( hasPreserved( BACKGROUND ) ) {
Color actualBackground = controlAdapter.getUserBackground();
boolean actualTransparency = controlAdapter.getBackgroundTransparency();
boolean colorChanged = changed( actualBackground, background, null );
boolean transparencyChanged = changed( actualTransparency, backgroundTransparency, false );
if( transparencyChanged || colorChanged ) {
RGB rgb = null;
int alpha = 0;
if( actualBackground != null ) {
rgb = actualBackground.getRGB();
alpha = actualTransparency ? 0 : actualBackground.getAlpha();
} else if( actualTransparency ) {
rgb = new RGB( 0, 0, 0 );
}
getRemoteObject().set( PROP_BACKGROUND, toJson( rgb, alpha ) );
}
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
if ((background != null || (getStyle() & SWT.DOUBLE_BUFFERED) == 0) && background.getAlpha() > 0) {
gc.setBackground(getBackground());
gc.fillRectangle(rect);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
if ((background != null || (getStyle() & SWT.DOUBLE_BUFFERED) == 0) && background.getAlpha() > 0) {
gc.setBackground(getBackground());
gc.fillRectangle(rect);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
if ((background != null || (getStyle() & SWT.DOUBLE_BUFFERED) == 0) && background.getAlpha() > 0) {
gc.setBackground(getBackground());
gc.fillRectangle(rect);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
if ((background != null || (getStyle() & SWT.DOUBLE_BUFFERED) == 0) && background.getAlpha() > 0) {
gc.setBackground(getBackground());
gc.fillRectangle(rect);
内容来源于网络,如有侵权,请联系作者删除!