leo2012 Posted July 21, 2012 at 04:38 PM Report #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)
renafi Posted July 21, 2012 at 07:46 PM Report #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
thoga31 Posted July 21, 2012 at 08:59 PM Report #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!
leo2012 Posted July 21, 2012 at 11:32 PM Author Report #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
leo2012 Posted July 21, 2012 at 11:38 PM Author Report #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
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