Skip to content

Copy constructor of the Image class is not working with SWT.IMAGE_COPY #271

@shlxue

Description

@shlxue

In hop-web issue: apache/hop#3508

in GuiResource.java#loadAsResource method

    SwtUniversalImage img =
        SwtSvgImageUtil.getUniversalImage(display, getClass().getClassLoader(), location);
    Image image;
    if (size > 0) {
      int newSize = (int) Math.round(size * zoomFactor);
      image = new Image(display, img.getAsBitmapForSize(display, newSize, newSize), SWT.IMAGE_COPY);
    } else {
      image = new Image(display, img.getAsBitmap(display), SWT.IMAGE_COPY);
    }
    img.dispose(); // dispose source image instance: img.getAs...
    return image;

Image.java#200(using reference?): internalImage = srcImage.internalImage;

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions