This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Drawing; | |
| using System.Drawing.Drawing2D; | |
| using System.Drawing.Imaging; | |
| using System.IO; | |
| public static class ImageUtil | |
| { | |
| public static Image Resize(this Image image, int width, int height) | |
| { | |
| var destRect = new Rectangle(0, 0, width, height); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class HtmlTruncator | |
| { | |
| public static string LimitOnWordBoundary(string str, int maxLength, string ellipses = "...") | |
| { | |
| XmlDocument doc = new XmlDocument(); | |
| XmlParserContext context = new XmlParserContext(doc.NameTable, new XmlNamespaceManager(doc.NameTable), null, XmlSpace.Preserve); | |
| XmlTextReader reader = new XmlTextReader("<xml>" + str + "</xml>", XmlNodeType.Document, context); | |
| bool shouldWriteEllipses; |
OlderNewer