Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 136,446 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,175 people online right now. Registration is fast and FREE... Join Now!




load picture using progress bar

 
Reply to this topicStart new topic

load picture using progress bar, uneble to load using this code" Dim FilePath As String = "C:

coderror
25 Jul, 2008 - 04:09 AM
Post #1

New D.I.C Head
*

Joined: 25 Jul, 2008
Posts: 1

CODE
Dim FilePath As String = "Copy of HPIM0428.jpeg"
        Try
            PictureBox1.Image = Image.FromFile(FilePath)
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Load Picture Using Progress Bar
25 Jul, 2008 - 05:03 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,993



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
First you're going to need to put an explanation of what problem you're having in the body of your post, not the description field (which only holds a limited number of characters). Second, this is VB.NET code so I'm moving this to the VB.NET forum smile.gif
User is offlineProfile CardPM
+Quote Post

indrora
RE: Load Picture Using Progress Bar
26 Jul, 2008 - 11:03 AM
Post #3

D.I.C Head
Group Icon

Joined: 25 Jul, 2008
Posts: 52


Dream Kudos: 25
My Contributions
Try this:

vb

Public Class Form1

Priate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
PictureBox1.LoadAsync(TextBox1.Text)
Catch ex As Exception

MessageBox.Show("Cant load image")

End Try
End Sub

Private Sub PictureBox1_LoadProgressChanged(ByVal sender As System.Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles PictureBox1.LoadProgressChanged

ProgressBar1.Value = e.ProgressPercentage

End Sub


Private Sub PictureBox1_LoadCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles PictureBox1.LoadCompleted
ProgressBar1.Value = 0
End Sub
End Class


... it'll load most any file as long as the pictuerbox can handle it tongue.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 02:47PM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month