Solved

vb.net - load image

Posted on 2010-08-14
2
292 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
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 85

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

914 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now