473,385 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Unloading a picture from a picturebox in VB.net

I have done some code to load a picture in an array of bytes. The data
is saved in a file in the Hard drive. There is also another piece of
code to display the image. My issue is that I need to unload the
picture before the user press the button to refresh and therefore
reload the image. Generally I would have an error when I try to
download the file and save it. I will have an error that the file is
being used by another process. Noticed that picturebox1.load = nothing
will unload the picture from the picturebox but it will not close the
file completely before going the next instructions. Checking "If
picturebox1.load is nothing = true will be true and therefore there
will no way to identify if the file has been closed or not. I don't
want to use the destroy method since this will remove the picturebox
completely, but if there is no solution to this, I have to destroy it
and recreating it at runtime.

Any suggestions pls?
Thanks
Jansen

Dec 2 '06 #1
0 1218

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jeff | last post by:
Hiya, Im currently in the process of developing a picture browser, I want it to run off a CD, basically I have 2 questions for the group. The first is how do I get the program to only view the...
4
by: Chris | last post by:
Hi, I am trying to set the position of a picture inside a picturebox with the folowing code: pctOutput.Picture = LoadPicture(App.Path & "\picture.bmp", , , , ) I didn't know what to fill...
10
by: Chris Coho, Jr. | last post by:
Ok, I'll explain the whole problem because there may be several ways to solve this and hopefully someone knows one. What I'm doing is creating a specialty template editor, similar to say a corel...
3
by: Sandra Setz | last post by:
Hi, Is it possible to assign the Picture property of a picturebox to the Picture property of an image control? I use an invisble picturebox to make some changes to a picture, but I want to...
1
by: Dennis | last post by:
Hello, Ive to draw a line on a picture i used this code: Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) x1 = z.X y1 = z.Y lbl3 = "x1: " & x1 lbl4...
2
by: Bill N. | last post by:
Using VB .Net 2003 Standard Edition. This simple form has a "File in Use" problem while the executable is running. Created this simple program to make sure that I hadn't done something in my...
2
by: Michael Lehar | last post by:
Hallo I have a pictureBox with a picture loaded from file, then I draw some lines on the picture, and then I want to save the new picture. Befor I can draw lines I have to create a Graphics...
1
by: Jeff Williams | last post by:
I have several picture boxes on a form. I want to be able to drag pictures to this picture box. On the Drop how can I tell which picture box I am dropping the picture on. Te picture Box control...
0
debasisdas
by: debasisdas | last post by:
Add two picture boxes to a form. Set the ScaleMode property of both the pictureboxes to 3-Pixels. General declaration -------------------------------- Const ubx = 1000 Const uby = 500 Dim...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.