|
static Color | parseColor (string value, Color defaultValue) |
|
static string | writeColor (Color value) |
|
static double[] | parseList (string text, double defaultValue) |
| Parses lists in the form "3,4,5,2,5" and "(3,4,40,50)". If a number cannot be parsed (i.e, number 2 in "5,,2,3") defaultValue is used. More...
|
|
static int | getInt (NameValueCollection q, string name, int defaultValue) |
|
static float | getFloat (NameValueCollection q, string name, float defaultValue) |
|
static double | getDouble (NameValueCollection q, string name, double defaultValue) |
|
static bool | getBool (NameValueCollection q, string name, bool defaultValue) |
|
static T | parseEnum< T > (string value, T defaultValue) |
|
static void | copyStream (Stream source, Stream dest) |
| Copies all remaining data from 'source' to 'dest' More...
|
|
static RotateFlipType | parseFlip (string sFlip) |
| Returns RotateNoneFlipNone if not a recognized value. More...
|
|
static double | parseRotate (string s) |
| Returns 0 if not a recognized value. Rounds the value to 0, 90, 180, or 270 More...
|
|
static double | normalizeTo90Intervals (double d) |
|
static RotateFlipType | combineFlipAndRotate (RotateFlipType flip, double angle) |
|
static string | writeFlip (RotateFlipType flip) |
| Throws an exception if the specified value is unsupported. Rotation values are not supported, and should be specified with the Rotate or srcRotate command. More...
|
|
static StretchMode | parseStretch (string value) |
|
static string | writeStretch (StretchMode value) |
|
static KeyValuePair< CropUnits,
double > | parseCropUnits (string value) |
|
static string | writeCropUnits (KeyValuePair< CropUnits, double > value) |
|
static ScaleMode | parseScale (string value) |
|
static string | writeScale (ScaleMode value) |
|
static KeyValuePair< CropMode,
double[]> | parseCrop (string value) |
|
static string | writeCrop (CropMode mode, double[] coords) |
|
static BoxPadding | parsePadding (string value) |
| Parses padding, allowing syntax (all) and (left, top, right, bottom). Parens are optional. More...
|
|
static PointF | parsePointF (string value, PointF defaultValue) |
|
static string | writePadding (BoxPadding p) |
|
static void | DrawOuterGradient (Graphics g, PointF[] poly, Color inner, Color outer, float width) |
| Draws a gradient around the specified polygon. Fades from 'inner' to 'outer' over a distance of 'width' pixels. More...
|
|
Definition at line 16 of file Utils.cs.
static double [] ImageResizer.Util.Utils.parseList |
( |
string |
text, |
|
|
double |
defaultValue |
|
) |
| |
|
inlinestatic |
Parses lists in the form "3,4,5,2,5" and "(3,4,40,50)". If a number cannot be parsed (i.e, number 2 in "5,,2,3") defaultValue is used.
- Parameters
-
- Returns
Definition at line 32 of file Utils.cs.
33 text = text.Trim(
' ',
'(',
')');
34 string[] parts = text.Split(
new char[] {
',' }, StringSplitOptions.None);
35 double[] vals =
new double[parts.Length];
36 for (
int i = 0; i < parts.Length; i++) {
37 if (!
double.TryParse(parts[i], floatingPointStyle, NumberFormatInfo.InvariantInfo, out vals[i]))
38 vals[i] = defaultValue;