Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

vb.net - load image

Posted on 2010-08-14
2
Medium Priority
?
298 Views
Last Modified: 2012-06-27
hello there,
how can I make something so that I can load an image into memory then display it on a picturebox..
because if I load the image into picturebox fromfile I cant edit the image because its in use..
0
Comment
Question by:XK8ER
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Expert Comment

by:Zhaolai
ID: 33439089
You can use ImageList to store a collection of images either at design time or run time and use it any where in your app.

0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 33439204
"...because if I load the image into picturebox fromfile I cant edit the image because its in use..."

Instead of FromFile() use FromStream() which does NOT leave the file locked.

Simple example:

    Dim fs As New System.IO.FileStream("c:\some\path\image.jpg", IO.FileMode.Open)
    PictureBox1.Image = Image.FromStream(fs)
    fs.Close()
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question