public static string[] getVideoDLUrls(string sID, eResolution eType, out string Errmsg) { Dictionary <string, string> pHash = getVideoResolutionList(sID, out Errmsg); if (pHash.Count <= 0) { return(null); } List <int> aRes = new List <int>(); for (int i = 0; i < pHash.Count; i++) { string item = StringHelper.GetSubString(pHash.ElementAt(i).Key, "x", null); aRes.Add(int.Parse(item)); } int iCmp = (int)eType; int iIndex = aRes.Count - 1; for (int i = 0; i < aRes.Count; i++) { if (iCmp >= aRes[i]) { iIndex = i; break; } } string sUrl = pHash.ElementAt(iIndex).Value; string sTxt = getString(sUrl, out Errmsg); List <string> pList = new List <string>(); string[] sArray = sTxt.Split("#EXTINF"); foreach (string item in sArray) { if (item.IndexOf("http") < 0) { continue; } string sValue = "http" + StringHelper.GetSubString(item, "http", "\n"); pList.Add(sValue); } return(pList.ToArray()); }
public Pdf2ImageConverter SelectResolution(eResolution resolution) { _outputResolution = (int)resolution; _outputResolutionSelected = true; return(this); }
/// <summary> /// convert any given position measurement to inches /// </summary> /// <param name="AStyleValue"></param> /// <param name="AResolution"></param> /// <returns></returns> private float ToInch(string AStyleValue, eResolution AResolution) { float FloatValue = GetFloat(AStyleValue); if (AStyleValue.EndsWith("cm")) { return FloatValue / 2.54f; } else if (AStyleValue.EndsWith("in")) { return FloatValue; } else if (AStyleValue.EndsWith("px")) { } // assume default unit to be pixel if (AResolution == eResolution.eHorizontal) { return FPrinter.PixelHorizontal(FloatValue); } return FPrinter.PixelVertical(FloatValue); }