Home All Groups Group Topic Archive Search About

Direction and suggestions needed

Author
21 Dec 2004 11:20 AM
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

--
Message posted via http://www.dotnetmonster.com
Author
21 Dec 2004 3:18 PM
Nick Malik
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" <fo***@DotNetMonster.com> wrote in
message news:e093ea492eb44bff92b031896d8c2c07@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?
Show quoteHide quote
>
> How would I go about including that whole image folder in my Deployment?
>
> Many thanks in advance
>
> --
> Message posted via http://www.dotnetmonster.com
Are all your drivers up to date? click for free checkup

Author
21 Dec 2004 6:24 PM
Stephen Dougherty via DotNetMonster.com
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

--
Message posted via http://www.dotnetmonster.com
Author
21 Dec 2004 9:57 PM
Chris, Master of All Things Insignificant
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


Show quoteHide quote
"Stephen Dougherty via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in
message news:0b4716cbd4124629ba7f2308548f50d2@DotNetMonster.com...
> 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
>
> --
> Message posted via http://www.dotnetmonster.com
Author
22 Dec 2004 12:48 AM
Stephen Dougherty via DotNetMonster.com
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

--
Message posted via http://www.dotnetmonster.com

Bookmark and Share