473,386 Members | 1,733 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,386 software developers and data experts.

what is wrong with this line

I am trying to use a bitmap in my asp.net page and I am running into a
problem because the name of the path has a space in it. Is this a limitation
of the function or am I just overlooking something?

If the filename has a space in the path i get an error "Invalid parameter".

Thanks in advance.

Tommy
Dim cPic As String = "d:\pics\picture.jpg" <---- works
Dim cPic As String = "d:\my pictures\picture.jpg" <---- does not work
Dim oPic As New Bitmap(cPic)
Nov 20 '05 #1
11 1036
I didn't do a repro, but it sounds like a problem with the constructor for
the Bitmap class.
How about just doing this to get around it:

Dim oPic As New Bitmap(chr(34) & cPic & chr(34))

Jerry

"Tommy Martin" <tm*****@xspam-tlmartin.com> wrote in message
news:Os**************@TK2MSFTNGP09.phx.gbl...
I am trying to use a bitmap in my asp.net page and I am running into a
problem because the name of the path has a space in it. Is this a limitation of the function or am I just overlooking something?

If the filename has a space in the path i get an error "Invalid parameter".
Thanks in advance.

Tommy
Dim cPic As String = "d:\pics\picture.jpg" <---- works
Dim cPic As String = "d:\my pictures\picture.jpg" <---- does not work
Dim oPic As New Bitmap(cPic)

Nov 20 '05 #2
Cor
Hi Tommy,

As far as I know till now, you can not use direct a bitmap in an asp.net
page.

HTML won't let you use a bitmap and an asp.net page is basicly HTML, so when
we go look for the error the endresult will probably be nothing.

Just something to warn you.

Cor
I am trying to use a bitmap in my asp.net page and I am running into a
problem because the name of the path has a space in it. Is this a limitation of the function or am I just overlooking something?

If the filename has a space in the path i get an error "Invalid

parameter".
Nov 20 '05 #3
I will give this a try.

"Jerry Ham" <Ye********************@Not.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I didn't do a repro, but it sounds like a problem with the constructor for
the Bitmap class.
How about just doing this to get around it:

Dim oPic As New Bitmap(chr(34) & cPic & chr(34))

Jerry

"Tommy Martin" <tm*****@xspam-tlmartin.com> wrote in message
news:Os**************@TK2MSFTNGP09.phx.gbl...
I am trying to use a bitmap in my asp.net page and I am running into a
problem because the name of the path has a space in it. Is this a

limitation
of the function or am I just overlooking something?

If the filename has a space in the path i get an error "Invalid

parameter".

Thanks in advance.

Tommy
Dim cPic As String = "d:\pics\picture.jpg" <---- works
Dim cPic As String = "d:\my pictures\picture.jpg" <---- does not work
Dim oPic As New Bitmap(cPic)


Nov 20 '05 #4
I am loading the bitmap and overlaying text on it then sending the
"image/jpeg" data back to the response stream. It works fine if there is no
space in the path.

Tommy

"Cor" <no*@non.com> wrote in message
news:ep**************@TK2MSFTNGP12.phx.gbl...
Hi Tommy,

As far as I know till now, you can not use direct a bitmap in an asp.net
page.

HTML won't let you use a bitmap and an asp.net page is basicly HTML, so when we go look for the error the endresult will probably be nothing.

Just something to warn you.

Cor
I am trying to use a bitmap in my asp.net page and I am running into a
problem because the name of the path has a space in it. Is this a

limitation
of the function or am I just overlooking something?

If the filename has a space in the path i get an error "Invalid

parameter".

Nov 20 '05 #5
"Tommy Martin" <tm*****@xspam-tlmartin.com> schrieb
I am trying to use a bitmap in my asp.net page and I am running into
a problem because the name of the path has a space in it. Is this a
limitation of the function or am I just overlooking something?

If the filename has a space in the path i get an error "Invalid
parameter".

Thanks in advance.

Tommy
Dim cPic As String = "d:\pics\picture.jpg" <---- works
Dim cPic As String = "d:\my pictures\picture.jpg" <---- does not
work
Dim oPic As New Bitmap(cPic)

"does not work" means? Compile error? Runtime exception? Which one?
Unexpected behavior?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6
Runtime error "Invalid parameter".

"Armin Zingler" <az*******@freenet.de> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
"Tommy Martin" <tm*****@xspam-tlmartin.com> schrieb
I am trying to use a bitmap in my asp.net page and I am running into
a problem because the name of the path has a space in it. Is this a
limitation of the function or am I just overlooking something?

If the filename has a space in the path i get an error "Invalid
parameter".

Thanks in advance.

Tommy
Dim cPic As String = "d:\pics\picture.jpg" <---- works
Dim cPic As String = "d:\my pictures\picture.jpg" <---- does not
work
Dim oPic As New Bitmap(cPic)

"does not work" means? Compile error? Runtime exception? Which one?
Unexpected behavior?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #7
* "Tommy Martin" <tm*****@xspam-tlmartin.com> scripsit:
Runtime error "Invalid parameter".

[...]
Dim cPic As String = "d:\my pictures\picture.jpg" <---- does not


Are you sure the path exists? Use 'System.IO.File.Exists' to check it.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8
Cor
Hi Tommy,

Are you sure your webpage has the proper rights to that directory?

Cor
Nov 20 '05 #9
"Tommy Martin" <tm*****@xspam-tlmartin.com> schrieb

Runtime error "Invalid parameter".


Unfortunately there is no list of possible exceptions in the docs to the
ctor. Did you also try it with other files in the _same_ directory? Can you
view the file from the explorer?

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #10
"Tommy Martin" <tm*****@xspam-tlmartin.com> wrote...
If the filename has a space in the path i get an error "Invalid parameter".
Dim cPic As String = "d:\pics\picture.jpg" <---- works
Dim cPic As String = "d:\my pictures\picture.jpg" <---- does not work
Dim oPic As New Bitmap(cPic)


There is nothing "wrong" with the code and it works fine with a space in the
path. And if the file didn't exist or the path was mistyped it wouldn't
yield and invalid parameter error.

So... I have to guess this isn't the exact code you have or something just
got all messed up. Delete the lines, save the project, restart Visual
Studio, retype the lines and try again. If it persists, start a dummy
project and just put the two lines into a test procedure... you will see
that it works.

Tom

Nov 20 '05 #11
"Tommy Martin" <tm*****@xspam-tlmartin.com> wrote...
If the filename has a space in the path i get an error "Invalid

parameter".

Hold on... is it "Invalid parameter used" ?

Check that the file in your "my pictures" folder really is a jpeg... rename
a text file to ".jpg" (to test it) for instance and you will get that error.
Nov 20 '05 #12

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

Similar topics

4
by: Simom Thorpe | last post by:
Hi, I'm trying to insert a line into a MS access DB using ASP on IIS 5. This is the line: con.execute "INSERT INTO newProds(title,desc,catcode) VALUES ('Champagne Muff Scarf','','AC304B')"...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
72
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for...
51
by: WindAndWaves | last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one of those NEVER USE. I can understand that it may lead to confusing code, but I often use it like this: is this...
22
by: noridotjabi | last post by:
Okay. I'm quite embarased to be asking this but I cannot seem to get files to work. I don't know what the problem is. Is there something wrong with this: (file related) #include <stdio.h>...
2
by: Phil | last post by:
Problem code: using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Diagnostics; namespace Streams { class Program {
2
by: Rod | last post by:
I've been struggling with this thing for 2 days, and after searching the 'net for help, I cannot find what is wrong. We're using Crystal Reports XI Release 2, with Visual Studio .NET 2003 in...
10
by: Enkidu | last post by:
Beginner question, sorry! I am using indexers to access an array of StringBuilders in an instance of a class: Getting: value = board1; Setting: board1 = value1 ;
6
by: Kid Programmer | last post by:
Hello guys. I have a question. What's wrong with my compiler. In a simple number averaging program in a GUI window have way into the project I compile the program and I get the following errors: ...
4
by: hirsh.dan | last post by:
i have a functions that writes information to a file. inside that function i have a line in which i call another function. if this line is executed, nothing is written to the file, but if i remark...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.