Image can't hold an image?

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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


    Gary B Guest

  2. Similar Questions and Discussions

    1. Open Image in 'Kodak Image Edit Control' with web browser.
      hi, 1.I want to show a image file of type '.tif' in the browser window; for that I'm writting as ASP code page. 2.This '.tif' type image can be...
    2. Resizing high res image smaller results in blurred image
      Hi there, I have a high res logo in PSD format (around 1500px x 1500px) but when I resize it to around 300px x 300px the resulting image is not...
    3. How To Browse for an image file and save it to image server folder
      I trying to browse for an image file and save it to the server image folder. in other words , upload the picture. I tried html and aspx.net...
    4. Can I take a small (320x240), blurry image, and make it a clear, large image?
      Just wondering if there is an easy way to do this? I'm sure it won't be perfect cause photoshop can only work with what's there, but maybe it can...
    5. Photoshop 7.0 Sliced Image Causes DreamWeaver MX Table To add 1 Pixel gif image!
      Hello, I sliced my page in Photoshop 7 and did a "Save Optimized" to HTML. I opened the page in Dreamweaver MX and it looks find. I want the TABLE...
  3. #2

    Default Re: Image can't hold an image?

    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
    [url]http://Steve.Orr.net[/url]


    "Gary B" <deanblakely@earthlink.net> wrote in message
    news:OBUd6p6VDHA.2040@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
    >
    >

    Steve C. Orr, MCSD Guest

  4. #3

    Default Re: Image can't hold an image?

    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" <Steve@Orr.net> wrote in message
    news:e$VhUZ7VDHA.3924@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:
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebHttpServerUtilityClassMapPathTopic.a sp[/url]
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD
    > [url]http://Steve.Orr.net[/url]
    >
    >
    > "Gary B" <deanblakely@earthlink.net> wrote in message
    > news:uCYeGT7VDHA.2316@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" <Steve@Orr.net> wrote in message
    > > news:u9NKJu6VDHA.2008@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
    > > > [url]http://Steve.Orr.net[/url]
    > > >
    > > >
    > > > "Gary B" <deanblakely@earthlink.net> wrote in message
    > > > news:OBUd6p6VDHA.2040@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
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Gary B Guest

  5. #4

    Default Re: Image can't hold an image?

    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
    [url]http://Steve.Orr.net[/url]


    "Gary B" <deanblakely@earthlink.net> wrote in message
    news:%23OQL647VDHA.3220@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" <Steve@Orr.net> wrote in message
    > news:e$VhUZ7VDHA.3924@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:
    > >
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebHttpServerUtilityClassMapPathTopic.a sp[/url]
    > >
    > > --
    > > I hope this helps,
    > > Steve C. Orr, MCSD
    > > [url]http://Steve.Orr.net[/url]
    > >
    > >
    > > "Gary B" <deanblakely@earthlink.net> wrote in message
    > > news:uCYeGT7VDHA.2316@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" <Steve@Orr.net> wrote in message
    > > > news:u9NKJu6VDHA.2008@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
    > > > > [url]http://Steve.Orr.net[/url]
    > > > >
    > > > >
    > > > > "Gary B" <deanblakely@earthlink.net> wrote in message
    > > > > news:OBUd6p6VDHA.2040@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
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Steve C. Orr, MCSD Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139