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

Image can't hold an image?

I'm converting a windows application to a web application. (by the way,
this is way easier than it used to be - many of the modules went over
untouched!)

The windows app used a pictuebox and got an image directly from a sqlserver
database. Upon examination of the Image web control, it seems the imageURL
property must come from a file? Is they anyway to directly feed it a vb.net
image object?
Thanks,
Gary
Nov 17 '05 #1
3 1737
No, you must use an image tag which links to a file. It doesn't have to be
a picture file though. You could link it to a ASPX page that dynamically
outputs the image.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Gary B" <de*********@earthlink.net> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl...
I'm converting a windows application to a web application. (by the way,
this is way easier than it used to be - many of the modules went over
untouched!)

The windows app used a pictuebox and got an image directly from a sqlserver database. Upon examination of the Image web control, it seems the imageURL property must come from a file? Is they anyway to directly feed it a vb.net image object?
Thanks,
Gary

Nov 17 '05 #2
Steve,
I had actually tried something like that earlier with
environmanet.currentdirectory but I changed my code to read as follows after
your suggestion:
FilePath = Server.MapPath("/DBAPhotoQuery")
FilePath = FilePath & "\currentPic.jpg"
--> at this point filePath is:
c:\inetpub\wwwroot\DBAPhotoQuery\currentPic.jpg
myImage.Save(FilePath, Imaging.ImageFormat.Jpeg)
DBAPictureBox1.ImageUrl = FilePath

This also gets a generic GDI + exception.
but if I insert:
FilePath = "c:\currentpic.jpg"
just before the myImage.save then it works!!

I've checked very carefully and the c:\inetpub.... string is valid. Maybe
its security related??
I appreciate the help so far,
Thanks
Gary

"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:e$**************@tk2msftngp13.phx.gbl...
The code sample you listed may work on your dev box, but it won't once you
move it to the server, because you haven't given a real URL.
You can use the Server.Mappath method to help with this.
Here's more info:
http://msdn.microsoft.com/library/de...pPathTopic.asp
--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Gary B" <de*********@earthlink.net> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Steve:
Well, the following works:
myImage.Save("C:\currentPic.jpg", Imaging.ImageFormat.Jpeg)
ImageCtrl.ImageUrl = "C:\currentpic.jpg"

But if I try to make it a relative url, such as ".\curentpic.jpg", the

.save
gets "a generic GDI + exception. How can I save it to the directory where
the web is running?
Thanks,
Gary


"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:u9**************@TK2MSFTNGP11.phx.gbl...
No, you must use an image tag which links to a file. It doesn't have to
be
a picture file though. You could link it to a ASPX page that

dynamically outputs the image.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Gary B" <de*********@earthlink.net> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl...
> I'm converting a windows application to a web application. (by the way, > this is way easier than it used to be - many of the modules went

over > untouched!)
>
> The windows app used a pictuebox and got an image directly from a
sqlserver
> database. Upon examination of the Image web control, it seems the
imageURL
> property must come from a file? Is they anyway to directly feed it a vb.net
> image object?
> Thanks,
> Gary
>
>



Nov 17 '05 #3
The ASPNET user account must have create/write privileges to whatever folder
you're trying to save to.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Gary B" <de*********@earthlink.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Steve,
I had actually tried something like that earlier with
environmanet.currentdirectory but I changed my code to read as follows after your suggestion:
FilePath = Server.MapPath("/DBAPhotoQuery")
FilePath = FilePath & "\currentPic.jpg"
--> at this point filePath is:
c:\inetpub\wwwroot\DBAPhotoQuery\currentPic.jpg
myImage.Save(FilePath, Imaging.ImageFormat.Jpeg)
DBAPictureBox1.ImageUrl = FilePath

This also gets a generic GDI + exception.
but if I insert:
FilePath = "c:\currentpic.jpg"
just before the myImage.save then it works!!

I've checked very carefully and the c:\inetpub.... string is valid. Maybe
its security related??
I appreciate the help so far,
Thanks
Gary

"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:e$**************@tk2msftngp13.phx.gbl...
The code sample you listed may work on your dev box, but it won't once you
move it to the server, because you haven't given a real URL.
You can use the Server.Mappath method to help with this.
Here's more info:

http://msdn.microsoft.com/library/de...pPathTopic.asp

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Gary B" <de*********@earthlink.net> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Steve:
Well, the following works:
myImage.Save("C:\currentPic.jpg", Imaging.ImageFormat.Jpeg)
ImageCtrl.ImageUrl = "C:\currentpic.jpg"

But if I try to make it a relative url, such as ".\curentpic.jpg", the

.save
gets "a generic GDI + exception. How can I save it to the directory where the web is running?
Thanks,
Gary


"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:u9**************@TK2MSFTNGP11.phx.gbl...
> No, you must use an image tag which links to a file. It doesn't
have to be
> a picture file though. You could link it to a ASPX page that dynamically
> outputs the image.
>
> --
> I hope this helps,
> Steve C. Orr, MCSD
> http://Steve.Orr.net
>
>
> "Gary B" <de*********@earthlink.net> wrote in message
> news:OB**************@TK2MSFTNGP10.phx.gbl...
> > I'm converting a windows application to a web application. (by
the way,
> > this is way easier than it used to be - many of the modules went

over > > untouched!)
> >
> > The windows app used a pictuebox and got an image directly from a
> sqlserver
> > database. Upon examination of the Image web control, it seems the
> imageURL
> > property must come from a file? Is they anyway to directly feed
it a > vb.net
> > image object?
> > Thanks,
> > Gary
> >
> >
>
>



Nov 17 '05 #4

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

Similar topics

5
by: ywg | last post by:
I'm generating an image using several PHP image routines: imagecreatefromjpeg, imagejpeg, etc. The PHP file containing these routines is meant to be included on web pages just like regular...
2
by: Mathias | last post by:
Dear NG, I currently ty to switch from matlab to python/scipy but have a lot of trouble with images. What I need is a function for subsequently displaying a number of 2D-matrices as an image. I...
1
by: Weston C | last post by:
I'm working on a small javascript application where I'd like to get one behavior when a user clicks on an image (image swap), but when they simply hold down the mouse button for a second, they get...
4
by: riki | last post by:
hi, i've asked this question before and didn't get an answer...maybe i didn't explain it well so i'll try again... -------------------------------------- main.html i'm calling popUp like...
3
by: coolsti | last post by:
I need some help here. I am making an application which allows a user to look at a series of picture files one at a time, and enter the outcome of various visual tests to a database. The...
1
by: D. Yates | last post by:
Hi, I am looking for an example of how to extract bitmap images from an embedded resource file (a file with *.res extension, which can be viewed inside of the ide and can hold bitmaps, icons,...
12
by: Sharon | last post by:
I’m wrote a small DLL that used the FreeImage.DLL (that can be found at http://www.codeproject.com/bitmap/graphicsuite.asp). I also wrote a small console application in C++ (unmanaged) that uses...
2
by: Noozer | last post by:
Code sample: dim hash as Hashtable 'Declare Hashtable .... hash.add (picOne.image, "picture") 'Error here picOne is a picturebox added to the form at design time with a GIF image applied....
5
by: moondaddy | last post by:
I'm caching a dataset in an asp.net session variable to hold a user's data. one data item I need to store is an image the user uploaded. My problem is that I don't know how to get the image into...
1
by: nikhilkajrekar | last post by:
i have picturedata and i want to save that to image file how i can do that i have this function but not working for all images Function FPictureDataToClipBoard(ctl As Variant) As Boolean '...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.