org.jclarion.clarion.print.Bitmap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clarion-runtime Show documentation
Show all versions of clarion-runtime Show documentation
JClarion runtime environment
/**
* Copyright 2010, by Andrew Barnham
*
* The contents of this file are subject to
* GNU Lesser General Public License (LGPL), v.3
* http://www.gnu.org/licenses/lgpl.txt
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
*/
package org.jclarion.clarion.print;
import java.awt.Image;
import org.jclarion.clarion.control.AbstractControl;
public class Bitmap extends AbstractElement
{
private Image image;
public Bitmap(AbstractControl control,int x1,int y1,int x2,int y2,Image image)
{
super(control,x1,y1,x2,y2,true);
this.image=image;
}
@Override
public void paint(Page r,PrintContext g)
{
int x1=r.scaleX(this.x1,false);
int y1=r.scaleY(this.y1,false);
int x2=r.scaleX(this.x2,true);
int y2=r.scaleY(this.y2,true);
g.drawImage(image,x1,y1,x2-x1,y2-y1);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy