private OfficeImage CreateImageFromResx(string name) { Assembly assembly = Assembly.GetExecutingAssembly(); Stream stream = assembly.GetManifestResourceStream("AutoCorrectEvent.Images." + name); OfficeImage im = OfficeImage.CreateImage(stream); return(im); }
void richEdit_Loaded(object sender, System.Windows.RoutedEventArgs e) { richEdit.SpellChecker = spellChecker; richEdit.Options.AutoCorrect.CorrectTwoInitialCapitals = true; richEdit.Options.AutoCorrect.UseSpellCheckerSuggestions = true; IAutoCorrectService service = richEdit.GetService <IAutoCorrectService>(); if (service != null) { AutoCorrectReplaceInfoCollection replaceTable = new AutoCorrectReplaceInfoCollection(); replaceTable.Add("(C)", "©"); replaceTable.Add(new AutoCorrectReplaceInfo(":)", OfficeImage.CreateImage(GetType().Assembly.GetManifestResourceStream("RichEditDemo.smile.png")))); replaceTable.Add("pctus", "Please do not hesitate to contact us again in case of any further questions."); replaceTable.Add("wnwd", "well-nourished, well-developed"); service.SetReplaceTable(replaceTable); } }
public OfficeImage CreateImage() { return(OfficeImage.CreateImage(CreateChart())); }