public override void setComposite(java.awt.Composite comp) { if (comp == null) { throw new java.lang.IllegalArgumentException("null Composite"); } this.composite = comp; }
internal static CompositeHelper Create(java.awt.Composite comp, Graphics graphics) { if (comp is java.awt.AlphaComposite) { java.awt.AlphaComposite alphaComp = (java.awt.AlphaComposite)comp; float alpha = alphaComp.getAlpha(); switch (alphaComp.getRule()) { case java.awt.AlphaComposite.CLEAR: graphics.CompositingMode = CompositingMode.SourceCopy; return(new ClearCompositeHelper()); case java.awt.AlphaComposite.SRC: graphics.CompositingMode = CompositingMode.SourceCopy; break; case java.awt.AlphaComposite.SRC_OVER: graphics.CompositingMode = CompositingMode.SourceOver; break; case java.awt.AlphaComposite.DST: graphics.CompositingMode = CompositingMode.SourceOver; alpha = 0.0F; break; default: graphics.CompositingMode = CompositingMode.SourceOver; Console.Error.WriteLine("AlphaComposite with Rule " + alphaComp.getRule() + " not supported."); break; } if (alpha == 1.0) { return(new CompositeHelper()); } else { return(new AlphaCompositeHelper(alpha)); } } else { graphics.CompositingMode = CompositingMode.SourceOver; Console.Error.WriteLine("Composite not supported: " + comp.GetType().FullName); return(new CompositeHelper()); } }
public override void setComposite(java.awt.Composite comp) { if (comp == null) { throw new java.lang.IllegalArgumentException("null Composite"); } this.javaComposite = comp; composite = CompositeHelper.Create(comp,g); java.awt.Paint oldPaint = javaPaint; javaPaint = null; setPaint(oldPaint); }