//// This code is part of Document Solutions for Word demos.// Copyright (c) MESCIUS inc. All rights reserved.//usingSystem.IO;usingSystem.Drawing;usingGrapeCity.Documents.Word; namespaceDsWordWeb.Demos{// Change color in picture.publicclassPicEffChangeColor {publicGcWordDocumentCreateDocx() {var doc = newGcWordDocument();Util.SetNarrowMargins(doc);var captionStyle = doc.Styles.Add("CaptionStyle", doc.Styles[BuiltInStyleId.BodyTextFirstIndent2]); // Read image from a file:var bytes = File.ReadAllBytes(Path.Combine("Resources", "Images", "wargravepink.jpg"));// Original picture: doc.Body.AddParagraph().AddRun().AddPicture(bytes, @"image/jpeg", 450, 300); doc.Body.AddParagraph("Original picture", captionStyle);// Add color change:var picture = doc.Body.AddParagraph().AddRun().AddPicture(bytes, @"image/jpeg", 450, 300);var colorChange = picture.ImageData.Effects.AddColorChange(newUserColor(Color.Black), newUserColor(Color.CadetBlue)); doc.Body.AddParagraph($"Color changed from {colorChange.ColorFrom.RGB} to {colorChange.ColorTo.RGB}", captionStyle);// Done:return doc; } }}