How to code image path relative to project

VB.NET

    Next

  • 1. Memorystream bitmap with tcpclient and sockets
    I have a memorystream of a bitmap, I want to send this over the network to a client app so it can receive the bitmap, I am dabbling with sockets and tcpclient's and ahve got a connection going but any documents I am looking up are not exactly what i am looking for and end up confusing me as I am not so familiar with this area, any help or code snippets would be great. thanks, barry.
  • 2. ContextMenuStrip in VB.NET2005b
    Hi I am using a single ContextMenuStrip on several CheckedListBoxes. Is there a way to find which CheckListBox was right-clicked? I checked the functions from ToolStripItemClickedEventArgs without finding anything, and I wouldn't like to create a ContextMenuStrip for each CheckListBoxes. Also, since there are a lot of sites on VB learning, can you propose a good site which would help me create a control? (I want to make a RadioButtonList, which would be more elegant than a simple List with what I have in mind) I currently test VB.NET 2005b, but if there is no answer for that version, an answer for VB.NET 2003 would be appreciated. Thank you
  • 3. How to fill DataSet from stored procedure?
    How to fill DataSet from stored procedure?
  • 4. DSOFILE.DLL - not with XML
    Hi, Anyone have any quick ideas as to why we can write extended file properties with dsofile.dll to all sorts of file formats - but not XML? Even in Word 2003, when I save as DOC extended file properties appear, but save as XML - they don't. Is this a Windows issue or a restriction in the DLL? TIA Don
  • 5. High resolution images in VB.NET
    Im trying to make a software in VB.NET that is supposed to handle high-res images, ive discovered theres a limit in the size of the bitmap object around 10000x10000 pixels. The program takes a number of input files and then create new files with parts of the input files. so basicly i load the input files in memory so the program will be as fast as possible, but now and then i get "out of memory" exceptions even tho the program only seem to use about 300Mb of ram the images i load is about 8000x7500 pixels tho i would like to load even larger files but the bitmap object seems to have the limit i spoke of. Is there any way to get around that limit? is there any object besides bitmap i can use to manipulate images, and could i use directx for my application if i wanted to make stuff go faster? If so, where can i find information on image editing in directx? Thanks!

How to code image path relative to project

Postby Dean Slindee » Sat, 12 Aug 2006 02:33:25 GMT

In order to deploy my app, I need to specify the following file path as 
relative to my project.  I need the image to be a file so that it can be 
processed by the "DrawImageToScale" function so that the image is reduced in 
size to a panel on the form.


      Dim img As Image = 
Image.FromFile("C:\Project\HumanServices\HumanServices\image\Contact.jpg")

      Call DrawImageToScale(picModule1, img)

 If this is not possible, is there a way to convert an embedded Resource 
into a File or Stream?



Thanks,

Dean S







RE: How to code image path relative to project

Postby aXdkdTE1 » Sat, 12 Aug 2006 02:50:01 GMT

is 

Image.FromFile(Application.StartupPath & "\Image\contact.jpg")

what your looking for?
-- 
-iwdu15

Re: How to code image path relative to project

Postby Mythran » Sat, 12 Aug 2006 03:02:43 GMT






To get the embedded resource as a stream, you use Reflection.  Look up the 
GetManifestResourceStream method on the Assembly class :)

HTH,
Mythran



Re: How to code image path relative to project

Postby Herfried K. Wagner [MVP] » Sat, 12 Aug 2006 07:03:27 GMT

"iwdu15" <jmmgoalsteratyahoodotcom> schrieb:

It's better to use 'Path.Combine' to concatenate the path with the file name 
to prevent problems arising when the program is installed into the root 
directory of the drive which may cause double backslashes to appear in the 
combined path.

-- 
 M S   Herfried K. Wagner
M V P  <URL: http://www.**--****.com/ ;
 V B   <URL: http://www.**--****.com/ ; 


Re: How to code image path relative to project

Postby Cor Ligthert [MVP] » Sat, 12 Aug 2006 14:07:46 GMT

Herfried,

Thank I will pay attention to that in future

Cor

"Herfried K. Wagner [MVP]" < XXXX@XXXXX.COM > schreef in bericht 





Similar Threads:

1.Project Output path converts to Relative path automatically

Hello there,

In the project configuration properties, whenever I change the
Build/Output path to a absolute path and close the window and If I go
there again I see it is automatically changed to a relative path. But I
want my project output to be a specific folder irrespective of where I
keep my solution.

For eg:
if I set the output path to "C:\Program files\MyApp\Bin" and apply it.
But If I go ther again it is changed to something like
"..\..\..\MyApp\Bin".

Does anybody have any idea why this behaviour is and how to change
this???

Btw, I'm using VS.NET 2003 IDE.

2.VB6 Relative paths in the VB project file (.vbp)

Hi All,

I hope I have the right forum for this question? 

I am having trouble building an exe from the vbp through our source control 
software when relative paths

are used to locate references. For a bit of background I am developing an in 
house application in VB6 and we are using Harvest for our source control, our 
desktop PC's have recently been migrated to XP while our Harvest server is 
still running on a NT Server.

The issue I am encountering is due to references in the vbp using relative 
paths instead of absolute. When the vbp

is checked out of source control it contains absolute paths to the reference 
files. But after development on an XP machine the project is saved and the 
reference paths in the vbp file are changed from absolute to relative. Once 
the vbp and associated files are checked back into Harvest a script is run on 
the Harvest server to build a new exe. 

This is the point where the process fails. Because the vbp contains relative 
paths the compiler is searching in the 

incorrect directory in Harvest for the referenced files.

I have been able to circumvent the issue by manually updating the vbp file 
through a text editor. But I am looking for

a more permanent solution. Is there any way I can switch off (force) VB6 to 
use relative paths instead of absolute?

Cheers

3.relative path for const in vba code

Hi All,

i have an excel-project with a separate xml file where config
information is stored. this xml is reference through a public constant
with an absolute path, like that:

Public Const strXMLFile As String = "D:\Documents and
Settings\t119637\Desktop\xls_work\Config\config.xml"

This works as long as the xls file runs on the machine where this
absolute file path is existing.
If i'd like to move these files (the excel file with the vba code and
the xml file) to another machine where this path is not existing, the
excel sheet wont work cause the xml file is not found.
Is there a ways to define a relative path to the xml file startin from
the actual xls file?
E.g:
the excel is stored in:
xls_work/myFile.xls
and the xml file is stored in
xls_work\Config\config.xml

So i would assume that the vba code needs to determine what the path to
the xls file is and add a /Config/config.xml to that path to have the
xls file work with the settings in the xml file.

I dont know the vba code that makes this possible

help woul be greatly apreciated
regards
thomas

4.Dynamically replacing relative path hyperlink with absolute path

I'm using Word 2002 SP3 (10.5522.6714).  
We are looking at the possibility of having to change the hyperlinks from 
relative to absolute paths in thousands of documents stored in multiple 
folders stored on a single drive.
Does anyone know of a way to replace these dynamically with a program?
Currently, the hyperlinks are mostly just a document name since the other 
document is in the same folder.  I need to be able to grab the complete path 
and add it to the file name in the hyperlink.

5.Image URL ....relative path

6. Create Image from relative path

7. Broken relative file paths when debugging file-system type web project in VS 2005

8. Howto: Including Source Code Files from a Relative Path



Return to VB.NET

 

Who is online

Users browsing this forum: No registered users and 48 guest