leo2012 Posted July 21, 2012 at 04:38 PM Report Share #469535 Posted July 21, 2012 at 04:38 PM Eu abro uma imagem,e mostra em um textbox,a localização dela,ai como eu faço pra pegar tambem a largura e a altura,e mostrar isso em outros dois textbox ? Tentei assim,mas só mostra o tamanho do arquivo,no total,e nao as dimensoes (altura e largura) Dim information As System.IO.FileInfo information = My.Computer.FileSystem.GetFileInfo(TextBox1.Text) TextBox2.Text = (information.Length) Link to comment Share on other sites More sharing options...
renafi Posted July 21, 2012 at 07:46 PM Report Share #469568 Posted July 21, 2012 at 07:46 PM Dim imagem as new Bitmap("localização do ficheiro") textbox1.text = imagem.Width textbox2.text = imagem.Height Oracle Certified Professional - AdministraçãoOracle Certified Professional - Pl/sqlMCPD - Microsoft Certified Professional DeveloperMCTS - Microsoft Certified Technology Specialist Link to comment Share on other sites More sharing options...
thoga31 Posted July 21, 2012 at 08:59 PM Report Share #469584 Posted July 21, 2012 at 08:59 PM Carregando a imagem numa variável do tipo Image ou Bitmap, poderás obter os valores Height e Width. 😉 Knowledge is free! Link to comment Share on other sites More sharing options...
leo2012 Posted July 21, 2012 at 11:32 PM Author Report Share #469603 Posted July 21, 2012 at 11:32 PM valeu cara,muito obrigado mesmo. Olha,esse site tem me ajudado muito,todos aqui são muito inteligentes. Eu so estava com um problema,quando tentei inserir esse código,pra colocar os valores em um numeric up,pois ele tinha um limite,era 100,ai fui mechendo e vi qe era so colocar NumeriUp.maximum = 200 ,ou quanto eu precisasse a mais,muito obrigado Link to comment Share on other sites More sharing options...
leo2012 Posted July 21, 2012 at 11:38 PM Author Report Share #469604 Posted July 21, 2012 at 11:38 PM Sim,obrigado,o código ficou assim : OpenFileDialog1.ShowDialog() TextBox1.Text = OpenFileDialog1.FileName NumericUpDown1.Maximum = 1000 NumericUpDown2.Maximum = 1000 Dim imagem As New Bitmap(TextBox1.Text) NumericUpDown1.Value = imagem.Height NumericUpDown2.Value = imagem.Width Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now