public void SetStrokeOpacity(PDFReal opacity) { StateInfo info = this.CurrentState; if (null == info) { throw new NullReferenceException("No current state to modify"); } if (info.Stroke != opacity.Value) { if (info.Registered == false) { PDFExtGSState state = new PDFExtGSState(); _container.Register(state); state.Name.WriteData(_writer); _writer.WriteOpCodeS(PDFOpCode.GraphApplyState); info.ExtState = state; info.Registered = true; } info.ExtState.States[Resources.PDFExtGSState.ColorStrokeOpacity] = opacity; info.Stroke = opacity.Value; } }
/// <summary> /// Overrides the base implementation to registed the image data as a resource on the current container /// </summary> /// <param name="context"></param> /// <param name="set"></param> /// <param name="fullstyle"></param> protected override void DoRegisterArtefacts(PDFLayoutContext context, PDFArtefactRegistrationSet set, Style fullstyle) { IPDFResourceContainer resources = this.GetResourceContainer(); if (null == resources) { throw RecordAndRaise.NullReference(Errors.ResourceContainerOfComponnetNotFound, "Image", this.ID); } PDFImageXObject xobj = this.GetImageObject(context, fullstyle); if (null != xobj) { resources.Register(xobj); } base.DoRegisterArtefacts(context, set, fullstyle); }