org.eclipse.swt.widgets.Shell.setBackgroundImage()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中org.eclipse.swt.widgets.Shell.setBackgroundImage()方法的一些代码示例,展示了Shell.setBackgroundImage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.setBackgroundImage()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:setBackgroundImage

Shell.setBackgroundImage介绍

暂无

代码示例

代码示例来源:origin: be.yildiz-games/module-window-swt

public void setBackground(Image background) {
  this.shell.setBackgroundImage(background);
}

代码示例来源:origin: stackoverflow.com

Image image = new Image(display, "c:\\picture.jpeg"); 
Shell shell = new Shell(SWT.NO_TRIM);
shell.setBounds(10,10,200,200);
shell.setBackgroundImage(image);
shell.setBackgroundMode(SWT.INHERIT_DEFAULT);
Label label = new Label(shell, SWT.NONE);
label.setText("LAbel text here. ");

代码示例来源:origin: be.yildiz-games/module-window-swt

public void setBackground(final String background) {
  this.shell.setBackgroundMode(SWT.INHERIT_DEFAULT);
  this.shell.setBackgroundImage(this.getImage(background));
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

currentShell.setText (ControlExample.getResourceString("Title") + shellCount);
if (imageButton.getSelection()) currentShell.setImage(instance.images[ControlExample.ciTarget]);
if (backgroundImageButton.getSelection()) currentShell.setBackgroundImage(instance.images[ControlExample.ciBackground]);
hookListeners (currentShell);
currentShell.open ();

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

return;
if (background != null)
  splashShell.setBackgroundImage(background);

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

@Override
  public void initialize(AnimationEngine engine) {
    display = getAnimationShell().getDisplay();

    Rectangle psRect = getAnimationShell().getBounds();
    theShell = new Shell(getAnimationShell(), SWT.NO_TRIM | SWT.ON_TOP);
    theShell.setBounds(getAnimationShell().getBounds());

    // Capture the background image
    backingStore = new Image(theShell.getDisplay(), psRect);
    GC gc = new GC(display);
    gc.copyArea(backingStore, psRect.x, psRect.y);
    gc.dispose();
//        changeCoordinates();
//        captureImages();
    theShell.setBackgroundImage(backingStore);
    theShell.setVisible(true);
    display.update();

  }

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

@Override
public void initialize(AnimationEngine engine) {
  Rectangle psRect = getBaseShell().getBounds();
  getAnimationShell().setBounds(psRect);
  // Capture the background image
  Display display = getBaseShell().getDisplay();
  backingStore = new Image(display, psRect);
  GC gc = new GC(display);
  // gc.copyArea(backingStore, psRect.x, psRect.y);
  gc.copyArea(backingStore, psRect.x, psRect.y);
  gc.dispose();
  getAnimationShell().setAlpha(254);
  getAnimationShell().setBackgroundImage(backingStore);
  getAnimationShell().setVisible(true);
}

代码示例来源:origin: org.xworker/xworker_swt

shell.setBackgroundImage(image);

代码示例来源:origin: stackoverflow.com

shell.setBackgroundImage(image);
shell.setBackgroundMode(SWT.INHERIT_DEFAULT);

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void widgetSelected(SelectionEvent ev) {
    
    Display display = Display.getCurrent();
    
    java.util.List<Image> shell_images = UIDebugGenerator.getShellImages();
    
    Image     biggest_image = null;
    long	biggest_area = 0;
    
    for ( Image image: shell_images ){
      Shell shell2 = new Shell(display);
      Rectangle bounds = image.getBounds();
      long area = bounds.width * bounds.height;
      if ( area > biggest_area ){
        biggest_image = image;
      }
      Point size = shell2.computeSize(bounds.width, bounds.height);
      shell2.setSize(size);
      shell2.setBackgroundImage(image);
      shell2.open();
    }
    
    if ( biggest_image != null ){
      new Clipboard(display).setContents(new Object[] {
          biggest_image.getImageData()
      }, new Transfer[] { ImageTransfer.getInstance() });
    }
  }
});

相关文章

微信公众号

最新文章

更多

Shell类方法