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

Bitmap Image path (possibly a noob question)

Hi there,

Me and a friend we want to clear a doubt on the Image method on the Bitmap Object:

We got jpeg files stored on our project solution (PDA) and we want to know if its possible to gave the path from the solution.

Basically, we want to know if its possible put write:

Expand|Select|Wrap|Line Numbers
  1. Bitmap newImage = new Bitmap(@"\images\maps1.JPG");
Instead of:

Expand|Select|Wrap|Line Numbers
  1. Bitmap newImage = new Bitmap(@"C:bla\bla\bla\images\maps1.JPG");
We've been trying with no sucess :( maybe the syntaxe we are using is wrong :S

Thanks in advance.
Jul 7 '08 #1
6 9173
Curtis Rutland
3,256 Expert 2GB
Is this ASP.NET or Windows Forms/Console?
Jul 7 '08 #2
kenobewan
4,871 Expert 4TB
I thought that you only needed @ for /. You need a virtual directory. This is usually achieved IIS.
Jul 7 '08 #3
Plater
7,872 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1. Bitmap newImage = new Bitmap(@"\images\maps1.JPG");
This is NOT a relative path. This will try to look in {root}\Images\ for that picture.

Try a reletive path maybe?
Expand|Select|Wrap|Line Numbers
  1. Bitmap newImage = new Bitmap(@"images\maps1.JPG");
Jul 7 '08 #4
Its a PDA solution.

I solved the problem. I had to put the file into the PDA and put the whole path.

It wasnt nothing big, the proclem is that i was using an emulator and i was using wrong paths (windows desktop path)
Jul 8 '08 #5
kenobewan
4,871 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1. Bitmap newImage = new Bitmap(@"\images\maps1.JPG");
This is NOT a relative path. This will try to look in {root}\Images\ for that picture.

Try a reletive path maybe?
Expand|Select|Wrap|Line Numbers
  1. Bitmap newImage = new Bitmap(@"images\maps1.JPG");
That would explain it. I support one web c# app so used to @ /. Thanks for the tip.
Jul 9 '08 #6
Plater
7,872 Expert 4TB
That would explain it. I support one web c# app so used to @ /. Thanks for the tip.
Hehe I suppose I should clarify the @ sign. It's used for string manipulations.

In C# this string will not compile
string fred ="billy\zane";
But these strings will:
string fred="billy\\zane";
striind john=@"billy\zane";

The @ sign says to ignore all possible escape sequences.
Jul 9 '08 #7

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

Similar topics

5
by: Erwin | last post by:
At the moment I'm using a report which contains an indicator to show if a Service group of the company isn't working well or is working perfectly. This indicator is a "*" which looks like a traffic...
2
by: TCR | last post by:
Hi, I posted this earlier and got a suggestion that didn't pan out. I am trying to determine if there is a known bug related to the resolution value returned when opening a .jpg file by passing...
6
by: Michael | last post by:
I'm trying to use the Bitmap class's Save Method to save a Bitmap as a GIF. My code runs fine, and converts the image, but the quality is not anywhere close to as good. I know that GIF quality is...
2
by: active | last post by:
I find Bitmap.Save works for WMF files but Bitmap.FromFile does not. If I use FromFile on a WMF file that came with VS I get an exception. If I use it on a WMF file created with Bitmap.Save I...
9
by: Peter Proost | last post by:
Hi group, I've got a question about the size of a saved bitmap. What I need to do is open a bitmap if it needs resizing, resize and save it. This isn't a problem, but the problem I have is that the...
8
by: Nathan Sokalski | last post by:
I am trying to write code to rotate a graphic that I have. Here is the code I am currently using: Dim frogbitmap As New Bitmap(Drawing.Image.FromFile(Server.MapPath("images/frog.gif"))) Dim...
0
by: news.microsoft.com | last post by:
Hi guys, This text looks long and complicate but it is not, and I really really need some help here. For the last 24hs I'm trying to resolve this issue (last night I dreamed
0
by: raylopez99 | last post by:
I have a minor problem locating an image file to load as a Bitmap. A resource file "NudeSusan.jpeg" (which I think is actually a bmp file, originally taken from a jpeg of model Susan Spears) is...
2
by: raylopez99 | last post by:
I can't get the below code to work, no matter how many times I change it. I do have the Image file, Image1, created (in another method), and using "hard coding" I can save it (it's a filled...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.