本文整理了Java中ij.gui.Overlay.<init>()
方法的一些代码示例,展示了Overlay.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Overlay.<init>()
方法的具体详情如下:
包路径:ij.gui.Overlay
类名称:Overlay
方法名:<init>
[英]Constructs an empty Overlay.
[中]构造一个空覆盖。
代码示例来源:origin: stackoverflow.com
var box = new Overlay();
代码示例来源:origin: stackoverflow.com
PDDocument watermarkDoc = PDDocument.load("watermark.pdf");
//Assuming your empty document with watermark image in it.
PDDocument realDoc = PDDocument.load("document-to-be-watermarked.pdf");
//Let's say this is your document that you want to watermark. For example sake, I am opening a new one, you would already have a reference to PDDocument if you are creating one
Overlay overlay = new Overlay();
overlay.overlay(realDoc,watermarkDoc);
watermarkDoc.save("document-now-watermarked.pdf");
代码示例来源:origin: stackoverflow.com
import java.io.File;
import java.util.HashMap;
import org.apache.pdfbox.multipdf.Overlay;
import org.apache.pdfbox.pdmodel.PDDocument;
public class TestPDF {
public static void main(String[] args) throws Exception{
PDDocument realDoc = PDDocument.load(new File("originaldocument.pdf"));
//the above is the document you want to watermark
//for all the pages, you can add overlay guide, indicating watermark the original pages with the watermark document.
HashMap<Integer, String> overlayGuide = new HashMap<Integer, String>();
for(int i=0; i<realDoc.getNumberOfPages(); i++){
overlayGuide.put(i+1, "watermark.pdf");
//watermark.pdf is the document which is a one page PDF with your watermark image in it.
//Notice here, you can skip pages from being watermarked.
}
Overlay overlay = new Overlay();
overlay.setInputPDF(realDoc);
overlay.setOutputFile("final.pdf");
overlay.setOverlayPosition(Overlay.Position.BACKGROUND);
overlay.overlay(overlayGuide);
}
}
代码示例来源:origin: net.imagej/ij
public Overlay getPrototypeOverlay() {
if (prototypeOverlay!=null)
return prototypeOverlay;
else
return new Overlay();
}
代码示例来源:origin: stackoverflow.com
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE); //no title
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); //fullscreen
overlay = new Overlay(this);
setContentView(R.layout.main);
addContentView(overlay, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
camera = getCameraInstance(); //camera.open();
preview = new Preview(this, camera);
((FrameLayout) findViewById(R.id.preview)).addView(preview);
}
代码示例来源:origin: ca.mcgill/Sholl_Analysis
private Overlay initializedOverlay() {
if (imp == null)
return new Overlay();
Overlay overlay = imp.getOverlay();
if (overlay == null) {
overlay = new Overlay();
imp.setOverlay(overlay);
}
return overlay;
}
代码示例来源:origin: net.imagej/imagej-legacy
@Override
@SuppressWarnings("unchecked")
public <T> T convert(final Object src, final Class<T> dest) {
if (!getInputType().isInstance(src)) throw new IllegalArgumentException(
"Unexpected source type: " + src.getClass());
if (!getOutputType().isAssignableFrom(dest))
throw new IllegalArgumentException("Unexpected output class: " + dest);
final ROITree rois = (ROITree) src;
final Overlay o = new Overlay();
addROIs(rois, o);
return (T) o;
}
代码示例来源:origin: stackoverflow.com
TourGuide mTourGuideHandler = TourGuide.init(this).with(TourGuide.Technique.Click)
.setPointer(new Pointer())
.setToolTip(new ToolTip().setTitle("Welcome!").setDescription("Click on Get Started to begin..."))
.setOverlay(new Overlay())
.playOn(button);
代码示例来源:origin: net.imagej/ij
/**
* @deprecated
* replaced by ImagePlus.setOverlay(Roi, Color, int, Color)
*/
public void setDisplayList(Roi roi, Color color) {
roi.setStrokeColor(color);
Overlay list = new Overlay();
list.add(roi);
setOverlay(list);
}
代码示例来源:origin: imagej/ImageJA
/**
* @deprecated
* replaced by ImagePlus.setOverlay(Roi, Color, int, Color)
*/
public void setDisplayList(Roi roi, Color color) {
roi.setStrokeColor(color);
Overlay list = new Overlay();
list.add(roi);
setOverlay(list);
}
代码示例来源:origin: ijpb/MorphoLibJ
public void drawPaths(ImagePlus target, Map<Integer, GeodesicDiameter.Result> geodDiams)
{
Overlay overlay = new Overlay();
Calibration calib = target.getCalibration();
for (GeodesicDiameter.Result result : geodDiams.values())
{
Roi roi = createPathRoi(result.path, calib);
roi.setStrokeColor(Color.RED);
overlay.add(roi);
}
target.setOverlay(overlay);
}
代码示例来源:origin: ijpb/MorphoLibJ
public void drawDiameters(ImagePlus target, Map<Integer, PointPair2D> geodDiams)
{
Overlay overlay = new Overlay();
Calibration calib = target.getCalibration();
for (PointPair2D result : geodDiams.values())
{
Roi roi = createDiametersRoi(result, calib);
roi.setStrokeColor(Color.BLUE);
overlay.add(roi);
}
target.setOverlay(overlay);
}
代码示例来源:origin: net.imagej/ij
/** Creates an Overlay from the specified ROI, and assigns it to this image.
* @see #setOverlay(ij.gui.Overlay)
*/
public void setOverlay(Roi roi, Color strokeColor, int strokeWidth, Color fillColor) {
roi.setStrokeColor(strokeColor);
roi.setStrokeWidth(strokeWidth);
roi.setFillColor(fillColor);
setOverlay(new Overlay(roi));
}
代码示例来源:origin: imagej/ImageJA
/** Creates an Overlay from the specified ROI, and assigns it to this image.
* @see #setOverlay(ij.gui.Overlay)
*/
public void setOverlay(Roi roi, Color strokeColor, int strokeWidth, Color fillColor) {
roi.setStrokeColor(strokeColor);
roi.setStrokeWidth(strokeWidth);
roi.setFillColor(fillColor);
setOverlay(new Overlay(roi));
}
代码示例来源:origin: net.imagej/ij
void updateRoiList(Rectangle rect) {
if (gel==null)
return;
if (overlay==null) {
overlay = new Overlay();
overlay.drawLabels(true);
overlay.setLabelColor(Color.white);
overlay.drawBackgrounds(true);
}
overlay.add(new Roi(rect.x, rect.y, rect.width, rect.height, null));
gel.setOverlay(overlay);
}
代码示例来源:origin: imagej/ImageJA
void updateRoiList(Rectangle rect) {
if (gel==null)
return;
if (overlay==null) {
overlay = new Overlay();
overlay.drawLabels(true);
overlay.setLabelColor(Color.white);
overlay.drawBackgrounds(true);
}
overlay.add(new Roi(rect.x, rect.y, rect.width, rect.height, null));
gel.setOverlay(overlay);
}
代码示例来源:origin: net.imagej/ij
/** Returns a new Overlay that has the same properties as this one. */
public Overlay create() {
Overlay overlay2 = new Overlay();
overlay2.drawLabels(label);
overlay2.drawNames(drawNames);
overlay2.drawBackgrounds(drawBackgrounds);
overlay2.setLabelColor(labelColor);
overlay2.setLabelFont(labelFont, scalableLabels);
overlay2.setIsCalibrationBar(isCalibrationBar);
overlay2.selectable(selectable);
return overlay2;
}
代码示例来源:origin: net.imagej/ij
void addRoi(ImagePlus imp, Roi roi){
Overlay overlay = imp.getOverlay();
if (overlay==null || overlay.size()==0) {
if (offscreenOverlay==null)
offscreenOverlay = new Overlay();
overlay = offscreenOverlay;
}
if (defaultColor!=null)
roi.setStrokeColor(defaultColor);
roi.setStrokeWidth(getProcessor().getLineWidth());
overlay.add(roi);
}
代码示例来源:origin: net.imagej/ij
public void setPrototypeOverlay(Overlay overlay) {
prototypeOverlay = new Overlay();
prototypeOverlay.drawLabels(overlay.getDrawLabels());
prototypeOverlay.drawNames(overlay.getDrawNames());
prototypeOverlay.drawBackgrounds(overlay.getDrawBackgrounds());
prototypeOverlay.setLabelColor(overlay.getLabelColor());
prototypeOverlay.setLabelFont(overlay.getLabelFont(), overlay.scalableLabels());
}
代码示例来源:origin: imagej/ImageJA
public void setPrototypeOverlay(Overlay overlay) {
prototypeOverlay = new Overlay();
prototypeOverlay.drawLabels(overlay.getDrawLabels());
prototypeOverlay.drawNames(overlay.getDrawNames());
prototypeOverlay.drawBackgrounds(overlay.getDrawBackgrounds());
prototypeOverlay.setLabelColor(overlay.getLabelColor());
prototypeOverlay.setLabelFont(overlay.getLabelFont(), overlay.scalableLabels());
}
内容来源于网络,如有侵权,请联系作者删除!