Solved

vb.net - load image

Posted on 2010-08-14
2
296 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vb.net deleting excel sheet in workbook 11 55
VB.net Is there code behind PowerPivot 2 72
Convert VB web project to C# 3 67
Convert a string to date 4 40
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…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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