예제 #1
0
 @Override
 protected Pattern toSubPattern(
     AbstractImageGL<?> image,
     boolean repeatX,
     boolean repeatY,
     float x,
     float y,
     float width,
     float height) {
   CanvasElement canvas = Document.get().createElement("canvas").<CanvasElement>cast();
   canvas.setWidth(MathUtil.iceil(width));
   canvas.setHeight(MathUtil.iceil(height));
   canvas.getContext2d().drawImage(img, x, y, width, height, 0, 0, width, height);
   ImageElement subelem = canvas.cast();
   return new HtmlPattern(image, subelem, repeatX, repeatY);
 }
예제 #2
0
 public HtmlImage(GLContext ctx, Scale scale, CanvasElement img) {
   super(ctx, scale);
   this.canvas = img;
   fakeComplete(img);
   this.img = img.cast();
 }
예제 #3
0
 public final void gwtSetImageAt(int index, CanvasElement element) {
   getImages().set(index, (ImageElement) element.cast());
 }