Hey!
I wrote a message yersterday and got some good answers and have now managed
to generate a nice image. The problem is that it's all generated in an
Images.Aspx file and I don't really want that. I am writing a WebControl
Library and I want to generate everything from there...
In the Render Sub of the Control I output some HTML and there I need to
reference to a file in the <img> element, is there anyway to NOT have to
point to a aspx file (that generated the picture) there and instead point to
a more local way that I can include in my WebControl Library?
I guess it's possible to render the image as a file and put on the
serverdisk and then point to it but that would be a security risk I guess
and can't really asume, that people that would use this control, like to set
permissions on the server to make it work.
How do I do this?
best regards/
Lars NetzelIf I am correct, you want to create a WebControl that creates an image AND
includes the <img=>... tags when rendered, correct?
You COULD put the binary image inline, but I would not recomend that.
From a browser's point of view an img tag creates another request to the
server to grab the image. So you would need 2 controls/pages:
1) The image creation page, which it looks like you aready have
(images.aspx)
2) The web control which renders the <img> tag.
The webcontrol will render something like "<img
src="/images.aspx?parameters" height=x width=x/>"
When the browser then gets this HTML, it will call up /images.aspx to grab
the actual image.
That's the most straight forward way of doing it that I can think of off
hand.
Steve
"Lars Netzel" <troligt@.apa.se> wrote in message
news:uNUt7i78EHA.2112@.TK2MSFTNGP14.phx.gbl...
> Hey!
> I wrote a message yersterday and got some good answers and have now
managed
> to generate a nice image. The problem is that it's all generated in an
> Images.Aspx file and I don't really want that. I am writing a WebControl
> Library and I want to generate everything from there...
> In the Render Sub of the Control I output some HTML and there I need to
> reference to a file in the <img> element, is there anyway to NOT have to
> point to a aspx file (that generated the picture) there and instead point
to
> a more local way that I can include in my WebControl Library?
> I guess it's possible to render the image as a file and put on the
> serverdisk and then point to it but that would be a security risk I guess
> and can't really asume, that people that would use this control, like to
set
> permissions on the server to make it work.
> How do I do this?
> best regards/
> Lars Netzel
>
Okay! Thanx, I was afraid of that that was the only way. The thign is I've
seen really Chart Controls for the web that renders 3d illustrations
using GDI+ and since they cost a lot I asume they have protected the code
for the image rendering and if it is like you say.. that you can only render
the image from an aspx file.. the code is pretty much open to all... and
also a bit harder to distribute, the user will need to add the aspx file to
his projects.. I wanted to see if it's possible to make a ONE dll solution
for the solution that would incluse all the pictures and just work.
What's your thoughts on this?
/Lars
"Steve Lutz" <slutz@.nospam.comcast.net> skrev i meddelandet
news:uq6Spt%238EHA.1204@.TK2MSFTNGP10.phx.gbl...
> If I am correct, you want to create a WebControl that creates an image AND
> includes the <img=>... tags when rendered, correct?
> You COULD put the binary image inline, but I would not recomend that.
> From a browser's point of view an img tag creates another request to the
> server to grab the image. So you would need 2 controls/pages:
> 1) The image creation page, which it looks like you aready have
> (images.aspx)
> 2) The web control which renders the <img> tag.
> The webcontrol will render something like "<img
> src="http://pics.10026.com/?src=/images.aspx?parameters" height=x width=x/>"
> When the browser then gets this HTML, it will call up /images.aspx to grab
> the actual image.
> That's the most straight forward way of doing it that I can think of off
> hand.
> Steve
>
> "Lars Netzel" <troligt@.apa.se> wrote in message
> news:uNUt7i78EHA.2112@.TK2MSFTNGP14.phx.gbl...
> managed
> to
> set
>
Hi Lars,
First, if your ASP.Net code is pretty much open to all, you have a SERIOUS
security hole on your web server!
Second, you must understand that in a web page, an image is requested via a
URL. Now, you could always write a custom HTTP handler that handles the
image request, but you will still have to have a URL that the HTTP handler
can respond to. It is actually much simpler (and just as secure) to do it
the easy way, and write an ASPX page that serves up the image.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Lars Netzel" <troligt@.apa.se> wrote in message
news:O67b7c$8EHA.824@.TK2MSFTNGP11.phx.gbl...
> Okay! Thanx, I was afraid of that that was the only way. The thign is I've
> seen really Chart Controls for the web that renders 3d illustrations
> using GDI+ and since they cost a lot I asume they have protected the code
> for the image rendering and if it is like you say.. that you can only
> render the image from an aspx file.. the code is pretty much open to
> all... and also a bit harder to distribute, the user will need to add the
> aspx file to his projects.. I wanted to see if it's possible to make a ONE
> dll solution for the solution that would incluse all the pictures and just
> work.
> What's your thoughts on this?
> /Lars
>
> "Steve Lutz" <slutz@.nospam.comcast.net> skrev i meddelandet
> news:uq6Spt%238EHA.1204@.TK2MSFTNGP10.phx.gbl...
>
So how does the big guys do this then, check this demosite out... It's a
picture that I guess has do be dynamically rendered... and there's no aspx
reference in the SRC of IMG element
http://demo.xceedsoft.com/XceedChartExplorer/
/Lars Netzel
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
news:OBZXio$8EHA.2568@.TK2MSFTNGP10.phx.gbl...
> Hi Lars,
> First, if your ASP.Net code is pretty much open to all, you have a SERIOUS
> security hole on your web server!
> Second, you must understand that in a web page, an image is requested via
> a URL. Now, you could always write a custom HTTP handler that handles the
> image request, but you will still have to have a URL that the HTTP handler
> can respond to. It is actually much simpler (and just as secure) to do it
> the easy way, and write an ASPX page that serves up the image.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> Neither a follower nor a lender be.
> "Lars Netzel" <troligt@.apa.se> wrote in message
> news:O67b7c$8EHA.824@.TK2MSFTNGP11.phx.gbl...
>
they are mapping the requested images to an image generating service on the
server ( ie. rewriting xxx.png as ImageGen.aspx?xxx )
"Lars Netzel" <troligt@.apa.se> wrote in message
news:%23X4ee$B9EHA.3820@.TK2MSFTNGP11.phx.gbl...
> So how does the big guys do this then, check this demosite out... It's a
> picture that I guess has do be dynamically rendered... and there's no aspx
> reference in the SRC of IMG element
> http://demo.xceedsoft.com/XceedChartExplorer/
>
> /Lars Netzel
>
> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
> news:OBZXio$8EHA.2568@.TK2MSFTNGP10.phx.gbl...
SERIOUS
via
the
handler
it
pretty
the
off
an
to
>
I've given you the basics. There are several ways to achieve this, one of
which I mentioned: a custom HTTP Handler. With a custom HTTP Handler, you
could use any file extension you like. However, as I said, that isn't
necessary in your case, and would probably be much more difficult for you to
implement, or you wouldn't have to ask.
If I was steering you wrong, believe me, somebody would have told you by
now! ;-)
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Lars Netzel" <troligt@.apa.se> wrote in message
news:%23X4ee$B9EHA.3820@.TK2MSFTNGP11.phx.gbl...
> So how does the big guys do this then, check this demosite out... It's a
> picture that I guess has do be dynamically rendered... and there's no aspx
> reference in the SRC of IMG element
> http://demo.xceedsoft.com/XceedChartExplorer/
>
> /Lars Netzel
>
> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
> news:OBZXio$8EHA.2568@.TK2MSFTNGP10.phx.gbl...
>
I appriciate you answers and your time spent on this thread. I just wanted
to see if there were other options than using an aspx file as image source.
I guess we'll wait until asp.net 2.0 and see what the DynamicImage control
can achieve!
/Lars
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
news:Ofx27kC9EHA.2608@.TK2MSFTNGP10.phx.gbl...
> I've given you the basics. There are several ways to achieve this, one of
> which I mentioned: a custom HTTP Handler. With a custom HTTP Handler, you
> could use any file extension you like. However, as I said, that isn't
> necessary in your case, and would probably be much more difficult for you
> to implement, or you wouldn't have to ask.
> If I was steering you wrong, believe me, somebody would have told you by
> now! ;-)
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> Neither a follower nor a lender be.
> "Lars Netzel" <troligt@.apa.se> wrote in message
> news:%23X4ee$B9EHA.3820@.TK2MSFTNGP11.phx.gbl...
>
okey, thanx, so they are also in need of an "online" service for the
picture, might not be a local "kick ass" solution that I thought.
/Lars
"gerry" <germ@.hotmail.com> skrev i meddelandet
news:e15WrOC9EHA.3336@.TK2MSFTNGP11.phx.gbl...
> they are mapping the requested images to an image generating service on
> the
> server ( ie. rewriting xxx.png as ImageGen.aspx?xxx )
>
> "Lars Netzel" <troligt@.apa.se> wrote in message
> news:%23X4ee$B9EHA.3820@.TK2MSFTNGP11.phx.gbl...
> SERIOUS
> via
> the
> handler
> it
> pretty
> the
> off
> an
> to
>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment