Direction and suggestions needed

  • Thread starter Thread starter Stephen Dougherty via DotNetMonster.com
  • Start date Start date
S

Stephen Dougherty via DotNetMonster.com

Firstly apologies if this has been covered elsewhere.

Being rather new to Developememnt in general, I am struggling to understand the deployment process of a .NET Windows application.

I have created a Window's application, which returns info based on what the user selects. For each item in the app there is an associated picture in .jpg format.

Code Example:
If cboItems.Text = "Veldspar crystal" Then
PictureBox7.Visible = True
PictureBox7.Image = System.Drawing.Image.FromFile _
("C:\Documents and Settings\stephen\Desktop\WindowsApplication5\images\icon48_01.jpg")

Path to .jpg is for testing only
All .jps are held in the images folder.

How would i control the deployment of that image folder to a set destination on the clients Computer ie C:\Program Files\EVECalc\images

Or is there a way to determine that path based on where the client installs the app?

How would I go about including that whole image folder in my Deployment?

Many thanks in advance
 
the easiest way is to include them in your project. When you create a setup
for your project, the JPG files will be included, as a subdirectory, under
where the project is installed.

You want to fix up this line:
PictureBox7.Image = System.Drawing.Image.FromFile _
("C:\Documents and
Settings\stephen\Desktop\WindowsApplication5\images\icon48_01.jpg")

so that you are reading the images from the subdirectory of the application
directory, and not from your Desktop folder on your dev machine :-)

I'm wondering, why do this at all? Why not just load the JPGs into picture
boxes in the dev environment and then just hide the boxes? Does the user
need to change these JPG images?

--
--- Nick Malik [MSFT]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
Stephen Dougherty via DotNetMonster.com said:
Firstly apologies if this has been covered elsewhere.

Being rather new to Developememnt in general, I am struggling to
understand the deployment process of a .NET Windows application.
I have created a Window's application, which returns info based on what
the user selects. For each item in the app there is an associated picture in
..jpg format.
Code Example:
If cboItems.Text = "Veldspar crystal" Then
PictureBox7.Visible = True
PictureBox7.Image = System.Drawing.Image.FromFile _
("C:\Documents and Settings\stephen\Desktop\WindowsApplication5\images\icon48_01.jpg")

Path to .jpg is for testing only
All .jps are held in the images folder.

How would i control the deployment of that image folder to a set
destination on the clients Computer ie C:\Program Files\EVECalc\images
 
Thanks for the reply Nick

I guess my Question was more about how to include these Pic's in the Project?

Can I somehow "reference" the Image Folder?

In the Setup, I am able to select a default installation folder, but what if the user wants to install it elsewhere.

How would I go about Loading the Jpg's into PictureBox's
How would this affect performance?

Regards and Thanks
Steve
 
You can embed the pictures in your project and then reference them as a
resource. Note you would not be accessing the image folder. Now, if you
want to have the image folder get installed when you install your project
you just need to make the path to folder relative to your exe.

PictureBox7.Image = System.Drawing.Image.FromFile _
(Application.StartupPath & "\images\icon48_01.jpg")

Note that in your dev enviroment you'll probably have to put there image
folder under the bin directory. Then all you will have to do is to add the
image folder to you install project.

Hope it helps
Chris
 
Thanks Chris

A little ahead of where I am in my Learning Curve
Could you suggest where I might find further article's or "How To's"
relating to this subject

Regards
Steve
 
Back
Top