public static string PathFixFile(string path, string lookfor) { string path2 = ""; if (path.Length > 0) { if (VbX.Right(path, 1) != slash) { path += slash; } path2 = path; } else { path2 = "." + slash; } try { foreach (string dir in Directory.GetFiles(path2)) { if (dir.ToLower() == path + lookfor.ToLower()) { return(dir); } } } catch (Exception ex) { VbX.MsgBox(ex.ToString()); } return(path + lookfor); }
public static System.Drawing.Image LoadImg(string filename) { // this gives Out of Memory on Linux filename = PathFix(filename); if (!File.Exists(filename)) { VbX.MsgBox("File not found:" + filename); return(null); } if (!IsLinux) { return(System.Drawing.Image.FromFile(filename)); } // I understand this does work on linux // VbX.MsgBox (filename); Stream sr = new FileStream(filename, FileMode.Open); System.Drawing.Image im = System.Drawing.Image.FromStream(sr); sr.Close(); sr = null; return(im); //return null; }
void addbytetodata(string b) { if (b.Length > 2) { VbX.MsgBox("Chunk too long!" + b); } RleData[RleDataPos] = (byte)VbX.HexToInt(b); RleDataPos++; }
void addbytetodata(int b) { if (b > 255) { VbX.MsgBox("Int too high!" + b); } RleData[RleDataPos] = (byte)b; RleDataPos++; }