473,624 Members | 2,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP ! Picture box problems

3 New Member
Hi

My problem consits of the following:-

i am creating mulitple picturebox's, when the user double clicks on the picture box it opens the opendialog box to load a picture (jpeg only) into the picture box.

When they have finished they press a button to save the picture's into certain files called Module1.jpeg, Module2.jpeg and so on. These files are created and saved automatically (i.e. not using the save dialog box).

When the whole application is open'd again the user presses a button to load all the save'd images into there picturebox's respectfully.

If the user then presses save again only changing one picture and the others are not changed then i get a ExtarnalExcepti on handler problem. i have caught the exception with (catch).

How do i do something with this (catch) how do i save the images that have been loaded inn so that the ExternalExcepti on goes away??

bit of a newb to this, any help in simple terms would be greatly apreciated :-)

thanks in advance
Feb 28 '07 #1
2 1174
radcaesar
759 Recognized Expert Contributor
Pass the user ID in session

Save the files with the user ID's Concatenated.

Don't use Open Dialog to save files.

Use file upload to do the same.

Retrieve the same files using the user ID (In the file name)

The other option is storing the same in the DB.

:)
Feb 28 '07 #2
blazingmavrick
3 New Member
thanks for the help but i think i may of post this thread in the wrong place im developing a form in vb 2005.

not sure what you mean by ID sessions.

sorry to be a pain but i am really new to this.

here is the problem code:-

Expand|Select|Wrap|Line Numbers
  1. Try
  2.             If PictureBox1.Enabled = True Then
  3.                 PictureBox1.Image.Save(FilePic1)
  4.             End If
  5.         Catch ex As NullReferenceException
  6.         Catch ex As Exception
  7.         End Try
this works first time around, it saves the image to the (filepic1) and when loaded back in by this code:-

Expand|Select|Wrap|Line Numbers
  1.  Try
  2.             Dim img1 As Image
  3.             Dim fs1 As New FileStream(FilePic1, IO.FileMode.OpenOrCreate)
  4.             img1 = Image.FromStream(fs1, OpenShare.Shared)
  5.             fs1.Close()
  6.             PictureBox1.Image = img1
  7.             PictureBox1.Refresh()
  8.         Catch ex As System.ArgumentException
  9.         Catch ex As IOException
  10.         End Try
it works fine. Its just when you press save again without changing the image(i.e. opening up dialog box and selecting new pic) it does not save anything !

close the programme and load the pictures back into there picturebox's respectfully and the one that was not changed(i.e. the one not saved) shows a blank picture box.

im really struggling with this :-(
Feb 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
13869
by: Trevor Fairchild | last post by:
I am making a program that categorizes pictures. The picture paths are stored in an Access Database, vb6 connects using adodc controls. This program works specifically with .jpg files. It will be used by people categorizing thousands of images. The problem I have is that both the picture control, and the image control seem unable to open certain jpg images for an unknown reason. The error message simply states "Invalid Picture". I can...
0
3431
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed Pentagjetvedeh karuvificials madhla reachathe strategy in karkun campaign deshatinst terrorism. "mudivae maretu winning or losing karkun global varti jetvedeh terror?" Mr. Rumsfeld adugued in a recent memormariyuum. vede velli jetvedeh madhla...
2
12394
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 code in the "real" project. In the "real" project, One part of the program saves multiple images and another part of the program moves the images to the appropriate directories based on user feedback.
4
12828
by: NASAdude | last post by:
I'm working on distributing a database using VS Tools for Office, and am having trouble with linked images on forms/reports. The image objects have a default path\file set on the .Picture property, which becomes invalid when the user installs the database (ie: c:\devpath\ becomes c:\program files\mydbapp, but the .Picture property still points to c:\devpath\) The problem is that I don't *know* what installation path the user will select,...
14
1997
by: Mat| | last post by:
Hello :-) I am learning XPath, and I am trying to get child nodes of a node whose names do *not* match a given string, e.g : <dummy> <example> <title>Example 1</title> <body>this is an example</body>
1
1892
by: blazingmavrick | last post by:
My problem consits of the following:- i am creating mulitple picturebox's, when the user double clicks on the picture box it opens the opendialog box to load a picture (jpeg only) into the picture box. using this code:- 'opens file dialog box to load selected jpeg into picture box OpenFD.InitialDirectory = "C:\My Documents\My Pictures" OpenFD.Title = "Open a JPEG file" OpenFD.Filter = "JPEG...
1
1372
by: basestring | last post by:
Hi, I need help for my program. I'm new With PHP but i have programming skills in VB so it's quit easy to understand this language, however. i got my self in some problems that i don't understand. I made a form that should add a record to a database and upload a picture to a databasepictures folder the problems is it doesn't upload the selected file. and $_files vars are empty
5
3072
by: Werner Partner | last post by:
I thought about your suggestion to leave tbales and, instead o, work with css. The problem is, that I still don't know veray much about css, so I have some difficulites to understand css-suggestions and to make little more complex designs by myself. Nevertheless I tried This is the original page:
4
5822
by: =?Utf-8?B?Q2FybGFKYWRl?= | last post by:
Can anyone help me? I need to use picture it 2000 every day and use to use it on Windows XP and had NO problems at all. If I would open up windows explorer i could be in my folder that has all of my picture it files in there, .mix files and even though they were not jpegs etc.. windows explorer would show the thumbnail of all of these projects saved so i could quickly look for something and double click to open. Since installing...
0
8231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8672
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8330
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7153
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6107
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2603
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1474
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.