473,503 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

simple question I think.

Hello,
I was having a problem saveing images that I edited with a vb.net
program. Every time I would save the image I would receive a GDI+ error. I
tried everything that I could think of including copying the photo album to
my local drive and I still kept getting the errors. Finally I tried copying
out only the folder that contained the images that I wanted to update and
everyting worked great. Here is the question. How man levels down can you
save a file in a directory? When I tried to save the file 5 levels down I
received an error. This could cause a problem because the photo album is
being used by legacy apps, and I can not change the structure of the album,
unless I want to change a couple of RPG programs (which I do NOT want to do).
Is there any way around this?

ex) c:/level2/level3/level4/level5/image.jpg ---> doesn't work

c:/level2/level3/image.jpg ---> works
Nov 21 '05 #1
6 1108
Hi Brian,

There should be no restrictions.

Can we see your code?

Bernie Yaeger

"Brian" <ja*****@amc.com> wrote in message
news:7E**********************************@microsof t.com...
Hello,
I was having a problem saveing images that I edited with a vb.net
program. Every time I would save the image I would receive a GDI+ error.
I
tried everything that I could think of including copying the photo album
to
my local drive and I still kept getting the errors. Finally I tried
copying
out only the folder that contained the images that I wanted to update and
everyting worked great. Here is the question. How man levels down can
you
save a file in a directory? When I tried to save the file 5 levels down I
received an error. This could cause a problem because the photo album is
being used by legacy apps, and I can not change the structure of the
album,
unless I want to change a couple of RPG programs (which I do NOT want to
do).
Is there any way around this?

ex) c:/level2/level3/level4/level5/image.jpg ---> doesn't work

c:/level2/level3/image.jpg ---> works

Nov 21 '05 #2
Here is an example
bmpImage.Save("C:\photos\00\00\" & x2 & "\0000" & x2 & y2 & ".jpg")
bmpImage.Save("C:\00\" & x2 & "\0000" & x2 & y2 & ".jpg")

The first line with 2 extra directories fails with a GDI error and the
second one works. If there is no directory issue, I am stumped. I can read
from the first one, but not save to. The second one is just a copy of the
"00" folder put in the C drive.

Any ideas?
"Bernie Yaeger" wrote:
Hi Brian,

There should be no restrictions.

Can we see your code?

Bernie Yaeger

"Brian" <ja*****@amc.com> wrote in message
news:7E**********************************@microsof t.com...
Hello,
I was having a problem saveing images that I edited with a vb.net
program. Every time I would save the image I would receive a GDI+ error.
I
tried everything that I could think of including copying the photo album
to
my local drive and I still kept getting the errors. Finally I tried
copying
out only the folder that contained the images that I wanted to update and
everyting worked great. Here is the question. How man levels down can
you
save a file in a directory? When I tried to save the file 5 levels down I
received an error. This could cause a problem because the photo album is
being used by legacy apps, and I can not change the structure of the
album,
unless I want to change a couple of RPG programs (which I do NOT want to
do).
Is there any way around this?

ex) c:/level2/level3/level4/level5/image.jpg ---> doesn't work

c:/level2/level3/image.jpg ---> works


Nov 21 '05 #3

"Brian" <ja*****@amc.com> wrote
Here is an example
bmpImage.Save("C:\photos\00\00\" & x2 & "\0000" & x2 & y2 & ".jpg")
bmpImage.Save("C:\00\" & x2 & "\0000" & x2 & y2 & ".jpg")

The first line with 2 extra directories fails with a GDI error and the
second one works. If there is no directory issue, I am stumped. I can read
from the first one, but not save to. The second one is just a copy of the
"00" folder put in the C drive.

Any ideas?


Verify that you you have write access to the folder and if all else fails,
try setting the working drive and directory to the one you want and
save the file by just using its name. (See ChDrive and ChDir to change
the current drive and directory).

LFS
Nov 21 '05 #4
"Brian" <ja*****@amc.com> schrieb:
I was having a problem saveing images that I edited with
a vb.net program. Every time I would save the image I
would receive a GDI+ error.
[...]
ex) c:/level2/level3/level4/level5/image.jpg ---> doesn't work

c:/level2/level3/image.jpg ---> works


Are you really using "/"? Replace them with "\". If this doesn't help:
Are you sure, the directories exist?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #5
Nope, sorry. My fingers just got ahead of the brain. I am using \.

"Herfried K. Wagner [MVP]" wrote:
"Brian" <ja*****@amc.com> schrieb:
I was having a problem saveing images that I edited with
a vb.net program. Every time I would save the image I
would receive a GDI+ error.
[...]
ex) c:/level2/level3/level4/level5/image.jpg ---> doesn't work

c:/level2/level3/image.jpg ---> works


Are you really using "/"? Replace them with "\". If this doesn't help:
Are you sure, the directories exist?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #6
Les
Brian,
I had a very similar problem to what you are having. What I cam up with was
2 differenct fixes, one for VB and one for C#. What I had to do in VB to get
things to work (I have 7 levels of directories) is to assemble the path in a
string before the actual function call, and then put the sting in the
function -- I know, extra line of code, but it worked for me. With C# I had
to add the "@" before the string showing it was a constant string and then
add the file name after. Took 1 more line of code than the VB answer. I
don't know why it didn't work in the function, but once the path and file
name were assembled out of the function in a string variable, things were
fine.

"Brian" wrote:
Nope, sorry. My fingers just got ahead of the brain. I am using \.

"Herfried K. Wagner [MVP]" wrote:
"Brian" <ja*****@amc.com> schrieb:
I was having a problem saveing images that I edited with
a vb.net program. Every time I would save the image I
would receive a GDI+ error.
[...]
ex) c:/level2/level3/level4/level5/image.jpg ---> doesn't work

c:/level2/level3/image.jpg ---> works


Are you really using "/"? Replace them with "\". If this doesn't help:
Are you sure, the directories exist?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #7

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

Similar topics

27
2341
by: Brian Sabbey | last post by:
Here is a first draft of a PEP for thunks. Please let me know what you think. If there is a positive response, I will create a real PEP. I made a patch that implements thunks as described here....
3
3659
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example...
13
5709
by: Michael B Allen | last post by:
Hi, I've tried to write the *simplest* memory allocator possible. I think it would be useful in many cases such as allocating memory on stack as a poor man's garbage collection perhaps. I was...
51
8207
by: Alan | last post by:
hi all, I want to define a constant length string, say 4 then in a function at some time, I want to set the string to a constant value, say a below is my code but it fails what is the correct...
7
1341
by: Mark Prenter | last post by:
Hi all, I'm fairly new to .NET and I haven't done much in C++ before, nothing complex anyway, but I have a pretty good understanding of programming in general. What I'm trying to do is create a...
10
2347
by: serge calderara | last post by:
Dear all, I need to build a web application which will contains articles (long or short) I was wondering on what is the correct way to retrive those article on web page. In orther words, when...
18
1486
by: Sender | last post by:
Yesterday there was a very long thread on this query. (You can search on this by post by 'sender' with subject 'Simple Problem' post date Oct 7 time 1:43p) And in the end the following code was...
18
1899
by: Bob Cummings | last post by:
Not sure if this is the correct place or not. Anyhow in school we were taught that when trying to calculate the efficiency of an algorithm to focus on something called FLOPs or Floating Point...
11
1662
by: samuelberthelot | last post by:
Hi, I've got 3 input HTML (dropdown lists) on my page. One for selecting a Month, one for the day, one for the year. Very simple... My problem is that I'd like to update the Days one according...
17
5788
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
0
7072
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
7319
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...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
373
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.