public static Gdk.Pixbuf LerArquivoPixbuf(string sCaminho) { sCaminho = Rotinas.ExtractFilePath(Rotinas.ExecutablePath()) + Path.DirectorySeparatorChar + "imagens" + Path.DirectorySeparatorChar + sCaminho; Gdk.Pixbuf pxb = new Gdk.Pixbuf(sCaminho); return(pxb); }
public static byte[] LerArquivoImagem(string sCaminho, bool bCaminhoPadrao) { if (bCaminhoPadrao) { sCaminho = Rotinas.ExtractFilePath(Rotinas.ExecutablePath()) + Path.DirectorySeparatorChar + "imagens" + Path.DirectorySeparatorChar + sCaminho; } byte[] imagebytes = null; FileStream fs = new FileStream(sCaminho, FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fs); imagebytes = br.ReadBytes(1000000); //imagebytes.GetLength(0) return(imagebytes); }