internal override void WriteChanges(Brush newBrush, MemoryStream stream, Resources resources) { if (newBrush is SolidBrush) { if (!_color.Equals((newBrush as SolidBrush)._color)) { if ((newBrush as SolidBrush)._color is ColorICC) { (newBrush as SolidBrush)._color.Colorspace.WriteColorSpaceForNotStroking(stream, resources); } IPDFPageOperation operation = new DefaultColorSpaceForNotStroking((newBrush as SolidBrush).Color); operation.WriteBytes(stream); } if (!_opacity.Equals((newBrush as SolidBrush)._opacity)) { PDFDictionary dict = new PDFDictionary(); dict.AddItem("ca", new PDFNumber((newBrush as SolidBrush)._opacity)); string name = resources.AddResources(ResourceType.ExtGState, dict); IPDFPageOperation operation = new GraphicsState(name); operation.WriteBytes(stream); } } else { newBrush.WriteParameters(stream, resources); } }
internal override void WriteChanges(Pen newPen, MemoryStream stream, Resources resources) { if (!_dashPattern.Equals(newPen.DashPattern)) { IPDFPageOperation operation = new LineDash(newPen.DashPattern); operation.WriteBytes(stream); } if (!_lineCap.Equals(newPen.LineCap)) { IPDFPageOperation operation = new LineCap(newPen.LineCap); operation.WriteBytes(stream); } if (!_lineJoin.Equals(newPen.LineJoin)) { IPDFPageOperation operation = new LineJoin(newPen.LineJoin); operation.WriteBytes(stream); } if (!_miterLimit.Equals(newPen.MiterLimit)) { IPDFPageOperation operation = new MiterLimit(newPen.MiterLimit); operation.WriteBytes(stream); } if (!_opacity.Equals(newPen.Opacity / 100)) { PDFDictionary dict = new PDFDictionary(); dict.AddItem("CA", new PDFNumber(newPen.Opacity / 100)); string name = resources.AddResources(ResourceType.ExtGState, dict); IPDFPageOperation operation = new GraphicsState(name); operation.WriteBytes(stream); } if (!_width.Equals(newPen.Width)) { IPDFPageOperation operation = new Linewidth(newPen.Width); operation.WriteBytes(stream); } if (newPen is SolidPen) { if (!_color.Equals((newPen as SolidPen).Color)) { if ((newPen as SolidPen)._color is ColorICC) { (newPen as SolidPen)._color.Colorspace.WriteColorSpaceForStroking(stream, resources); } newPen.WriteParameters(stream, resources); } } else { newPen.WriteParameters(stream, resources); } }
internal override void WriteParameters(MemoryStream stream, Resources resources) { if (_color is ColorICC) { _color.Colorspace.WriteColorSpaceForNotStroking(stream, resources); } IPDFPageOperation operation = new DefaultColorSpaceForNotStroking(_color); operation.WriteBytes(stream); PDFDictionary dict = new PDFDictionary(); dict.AddItem("ca", new PDFNumber(_opacity / 100)); string name = resources.AddResources(ResourceType.ExtGState, dict); operation = new GraphicsState(name); operation.WriteBytes(stream); }