Ask a Question related to ASP.NET General, Design and Development.
-
Tina #1
display new bitmap
I'm in a button clicked event on mainpage.aspx. I want to display a new
webpage that has just my image, which is a jpg. I want the page to be a
..jpg not an aspx so that it will be easy for the user to save to disk.
How can I do this?
Thanks,
T
Tina Guest
-
how to edit bitmap which is imported in flash using xmland save the edited bitmap back to xml in flash.
hi all It would be appreciated if any one let me know how to edit bitmap which is imported in flash using xml and save the edited bitmap back to... -
Multiple DB Columns display in <cfselect display>
*disclaimer* -- I'm a CF n00b. Hello all, -
How to cut out bitmap ???
Show me the way to cut out bitmap ,please ??? Thanks -
LG 700S monitor display does not work for 1024x768 display
Hello, I have a LG 700S 17 inch monitor which does not work for the display setting of 1024X768 in Red Hat Linux 8.0. Has anyone of you having... -
Add a Bitmap ???
I need to add a dynamical!! generated bitmap to an image button! What is the way to do it? The ImageButton offers only the URL property. But this... -
Natty Gur #2
Re: display new bitmap
Hi,
change the ContentType and write the jpeg.
Response.ContentType = "image/jepg"
...
oBmp = New Bitmap(strPath)
...
oBmp.Save(Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Jpeg)
Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
Tina #3
Re: display new bitmap
there are two pages involved, webform1.aspx and HiRes.aspx. In
Webform1.aspx I write a .jpg to the root of d: and do :
Server.Transfer("HiRes.aspx")
HiRes.aspx is as follows:
<%@ Page Language="vb" ContentType="image/jpeg" AutoEventWireup="false"
Codebehind="HiRes.aspx.vb" Inherits="DBAPhotoQuery.HiRes"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>test</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">
<form id="Form1" target="_blank" method="post" runat="server">
</form>
</body>
</html>
and the CodeBehind for hires.aspx is as follows:
Imports System.Drawing.Imaging
Public Class HiRes
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Response.Clear()
Dim oBmp As Bitmap
oBmp = New Bitmap("d:\bigpic.jpg")
oBmp.Save(Response.OutputStream, imageformat.jpeg)
Response.End()
End Sub
End Class
What happens is that the picture does indeed get written but to
webform1.aspx. What was in webform1.aspx is completely replaced by just the
image. You might notice that I put Target="_blank" in an attempt to get it
to display a new i.e. page.
Thanks,
T
"Jerry III" <jerryiii@hotmail.com> wrote in message
news:uL66NVhWDHA.2256@TK2MSFTNGP10.phx.gbl...and> What does it come as? You're clearly telling the client that it's an
> image/jpeg and you're saving it as such and I'm doing this all the timefrom> it works just fine. Could you be more specific? Maybe you're saving more
> than the image to the response or you're not setting the headers right...
>
> Jerry
>
> "Tina" <tinamseaburn@excite.com> wrote in message
> news:uzK6iwgWDHA.1900@TK2MSFTNGP10.phx.gbl...> fore> > Natty,
> > That doesn't come through to the client browser as a .jpg and is there> I> > either impossible or very difficult for them to save the file as a .jpg.> > do this all the time from static pages but can't seem to make it work>> > aspx pages and vb.net code.
> > Thanks,
> > T
> > "Natty Gur" <natty@dao2com.com> wrote in message
> > news:e1MpZ9XWDHA.216@TK2MSFTNGP11.phx.gbl...> >> > > Hi,
> > >
> > > change the ContentType and write the jpeg.
> > > Response.ContentType = "image/jepg"
> > > ..
> > > oBmp = New Bitmap(strPath)
> > > ..
> > > oBmp.Save(Response.OutputStream,
> > > System.Drawing.Imaging.ImageFormat.Jpeg)
> > >
> > > Natty Gur, CTO
> > > Dao2Com Ltd.
> > > 34th Elkalay st. Raanana
> > > Israel , 43000
> > > Phone Numbers:
> > > Office: +972-(0)9-7740261
> > > Fax: +972-(0)9-7740261
> > > Mobile: +972-(0)58-888377
> > >
> > >
> > > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> > > Don't just participate in USENET...get rewarded for it!
> >
>
Tina Guest
-
Natty Gur #4
Re: display new bitmap
You dont set the content header :
Response.ContentType = "image/jepg"
Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
Jerry III #5
Re: display new bitmap
Tina,
this is completely wrong. You're trying to send a jpeg image from Hires.aspx
yet you're sending HTML tags to the response. If you want to do that there
should be nothing (and I mean nothing) in the page except page directives
and server side script. In your case (using code behind) only the single
Page directive should be in your aspx file, like this:
<%@ Page Language="vb" ContentType="image/jpeg" AutoEventWireup="false"
Codebehind="HiRes.aspx.vb" Inherits="DBAPhotoQuery.HiRes"%>
Anything else (such as your HTML in it) will be sent down to the client
effectively breaking your jpeg image data. Of course a cleaner way is to
send it through a render function instead of in OnLoad event but from the
functionally point of view it doesn't matter.
BTW why do you create a file on your disk drive and then send it? Wouldn't
it be easier to send it directly without writing it to the drive?
Jerry
"Tina" <tinamseaburn@excite.com> wrote in message
news:%23VAwdyhWDHA.1940@TK2MSFTNGP10.phx.gbl...the> there are two pages involved, webform1.aspx and HiRes.aspx. In
> Webform1.aspx I write a .jpg to the root of d: and do :
> Server.Transfer("HiRes.aspx")
>
> HiRes.aspx is as follows:
> <%@ Page Language="vb" ContentType="image/jpeg" AutoEventWireup="false"
> Codebehind="HiRes.aspx.vb" Inherits="DBAPhotoQuery.HiRes"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <html>
> <head>
> <title>test</title>
> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> <meta name=vs_defaultClientScript content="JavaScript">
> <meta name=vs_targetSchema
> content="http://schemas.microsoft.com/intellisense/ie5">
> </head>
> <body MS_POSITIONING="GridLayout">
>
> <form id="Form1" target="_blank" method="post" runat="server">
>
> </form>
>
> </body>
> </html>
>
> and the CodeBehind for hires.aspx is as follows:
>
> Imports System.Drawing.Imaging
> Public Class HiRes
> Inherits System.Web.UI.Page
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Response.Clear()
> Dim oBmp As Bitmap
> oBmp = New Bitmap("d:\bigpic.jpg")
> oBmp.Save(Response.OutputStream, imageformat.jpeg)
> Response.End()
> End Sub
> End Class
>
> What happens is that the picture does indeed get written but to
> webform1.aspx. What was in webform1.aspx is completely replaced by justit> image. You might notice that I put Target="_blank" in an attempt to getright...> to display a new i.e. page.
> Thanks,
> T
> "Jerry III" <jerryiii@hotmail.com> wrote in message
> news:uL66NVhWDHA.2256@TK2MSFTNGP10.phx.gbl...> and> > What does it come as? You're clearly telling the client that it's an
> > image/jpeg and you're saving it as such and I'm doing this all the time> > it works just fine. Could you be more specific? Maybe you're saving more
> > than the image to the response or you're not setting the headers..jpg.> >
> > Jerry
> >
> > "Tina" <tinamseaburn@excite.com> wrote in message
> > news:uzK6iwgWDHA.1900@TK2MSFTNGP10.phx.gbl...> > fore> > > Natty,
> > > That doesn't come through to the client browser as a .jpg and is there> > > either impossible or very difficult for them to save the file as a> from> > I> > > do this all the time from static pages but can't seem to make it work>> >> > > aspx pages and vb.net code.
> > > Thanks,
> > > T
> > > "Natty Gur" <natty@dao2com.com> wrote in message
> > > news:e1MpZ9XWDHA.216@TK2MSFTNGP11.phx.gbl...
> > > > Hi,
> > > >
> > > > change the ContentType and write the jpeg.
> > > > Response.ContentType = "image/jepg"
> > > > ..
> > > > oBmp = New Bitmap(strPath)
> > > > ..
> > > > oBmp.Save(Response.OutputStream,
> > > > System.Drawing.Imaging.ImageFormat.Jpeg)
> > > >
> > > > Natty Gur, CTO
> > > > Dao2Com Ltd.
> > > > 34th Elkalay st. Raanana
> > > > Israel , 43000
> > > > Phone Numbers:
> > > > Office: +972-(0)9-7740261
> > > > Fax: +972-(0)9-7740261
> > > > Mobile: +972-(0)58-888377
> > > >
> > > >
> > > > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> > > > Don't just participate in USENET...get rewarded for it!
> > >
> > >
> >
>
Jerry III Guest
-
Tina #6
Re: display new bitmap
Jerry,
The problem is:
First, the desired solution is...
The user is interacting with Webform1.aspx. A button on that form should
bring up a new browser window where the url is a .jpg and the image is
displayed in that new browser window. Because the url is a .jpg, the user
can easily save it to his local disk. He can then continue interacting with
webform1, bringing up new pictures and saving them as desired.
What is happening is...
when the user hit's the button on Webform1, everything on webform1 is wiped
out and replaced by the hi res picture. The url still says
[url]www.mysite.com/myApp/Webform1.aspx[/url]. This is all bad because (1) Webform1
got wiped out and user needs to back arrow to continue and (2) the user
can't save the image because the url is not a .jpg.
I think this, coupled with my description below pretty much describes this
problem I am having.
Thanks for bearing with me so far,
T
"Jerry III" <jerryiii@hotmail.com> wrote in message
news:OwizrFmWDHA.2880@tk2msftngp13.phx.gbl...time> Take my last message back (well, you should still clean up the page, if
> you're sending an image then there should be no HTML for clarity).
>
> You're saying that the image renders fine on the client side, what exactly
> is the problem then?
>
> Jerry
>
> "Tina" <tinamseaburn@excite.com> wrote in message
> news:%23VAwdyhWDHA.1940@TK2MSFTNGP10.phx.gbl...> the> > there are two pages involved, webform1.aspx and HiRes.aspx. In
> > Webform1.aspx I write a .jpg to the root of d: and do :
> > Server.Transfer("HiRes.aspx")
> >
> > HiRes.aspx is as follows:
> > <%@ Page Language="vb" ContentType="image/jpeg" AutoEventWireup="false"
> > Codebehind="HiRes.aspx.vb" Inherits="DBAPhotoQuery.HiRes"%>
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <html>
> > <head>
> > <title>test</title>
> > <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > <meta name=vs_defaultClientScript content="JavaScript">
> > <meta name=vs_targetSchema
> > content="http://schemas.microsoft.com/intellisense/ie5">
> > </head>
> > <body MS_POSITIONING="GridLayout">
> >
> > <form id="Form1" target="_blank" method="post" runat="server">
> >
> > </form>
> >
> > </body>
> > </html>
> >
> > and the CodeBehind for hires.aspx is as follows:
> >
> > Imports System.Drawing.Imaging
> > Public Class HiRes
> > Inherits System.Web.UI.Page
> >
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> > Response.Clear()
> > Dim oBmp As Bitmap
> > oBmp = New Bitmap("d:\bigpic.jpg")
> > oBmp.Save(Response.OutputStream, imageformat.jpeg)
> > Response.End()
> > End Sub
> > End Class
> >
> > What happens is that the picture does indeed get written but to
> > webform1.aspx. What was in webform1.aspx is completely replaced by just> it> > image. You might notice that I put Target="_blank" in an attempt to get> > to display a new i.e. page.
> > Thanks,
> > T
> > "Jerry III" <jerryiii@hotmail.com> wrote in message
> > news:uL66NVhWDHA.2256@TK2MSFTNGP10.phx.gbl...> > > What does it come as? You're clearly telling the client that it's an
> > > image/jpeg and you're saving it as such and I'm doing this all themore> > and> > > it works just fine. Could you be more specific? Maybe you're savingthere> right...> > > than the image to the response or you're not setting the headers> > >
> > > Jerry
> > >
> > > "Tina" <tinamseaburn@excite.com> wrote in message
> > > news:uzK6iwgWDHA.1900@TK2MSFTNGP10.phx.gbl...
> > > > Natty,
> > > > That doesn't come through to the client browser as a .jpg and iswork> .jpg.> > > fore
> > > > either impossible or very difficult for them to save the file as a> > > I
> > > > do this all the time from static pages but can't seem to make it>> > from> >> > > > aspx pages and vb.net code.
> > > > Thanks,
> > > > T
> > > > "Natty Gur" <natty@dao2com.com> wrote in message
> > > > news:e1MpZ9XWDHA.216@TK2MSFTNGP11.phx.gbl...
> > > > > Hi,
> > > > >
> > > > > change the ContentType and write the jpeg.
> > > > > Response.ContentType = "image/jepg"
> > > > > ..
> > > > > oBmp = New Bitmap(strPath)
> > > > > ..
> > > > > oBmp.Save(Response.OutputStream,
> > > > > System.Drawing.Imaging.ImageFormat.Jpeg)
> > > > >
> > > > > Natty Gur, CTO
> > > > > Dao2Com Ltd.
> > > > > 34th Elkalay st. Raanana
> > > > > Israel , 43000
> > > > > Phone Numbers:
> > > > > Office: +972-(0)9-7740261
> > > > > Fax: +972-(0)9-7740261
> > > > > Mobile: +972-(0)58-888377
> > > > >
> > > > >
> > > > > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> > > > > Don't just participate in USENET...get rewarded for it!
> > > >
> > > >
> > >
> > >
> >
>
Tina Guest
-
Tina #7
Re: display new bitmap
Ok, your right. I put that in my code and it made no difference.
Thanks,
T
"Natty Gur" <natty@dao2com.com> wrote in message
news:egG7jZjWDHA.3232@tk2msftngp13.phx.gbl...> You dont set the content header :
>
> Response.ContentType = "image/jepg"
>
>
> Natty Gur, CTO
> Dao2Com Ltd.
> 34th Elkalay st. Raanana
> Israel , 43000
> Phone Numbers:
> Office: +972-(0)9-7740261
> Fax: +972-(0)9-7740261
> Mobile: +972-(0)58-888377
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Tina Guest
-
Jerry III #8
Re: display new bitmap
You need to set the target attribute to _blank on your form to open the
image in a new window. Like this:
<form target="_blank"...>...</form>
Or you can use a link (<a>) with the same attribute.
If I understand you correctly you don't have a problem displaying the image,
right? You just want it to open in a new window?
Jerry
"Tina" <tinamseaburn@excite.com> wrote in message
news:unzRUXqWDHA.2064@TK2MSFTNGP11.phx.gbl...with> Jerry,
> The problem is:
> First, the desired solution is...
> The user is interacting with Webform1.aspx. A button on that form should
> bring up a new browser window where the url is a .jpg and the image is
> displayed in that new browser window. Because the url is a .jpg, the user
> can easily save it to his local disk. He can then continue interactingwiped> webform1, bringing up new pictures and saving them as desired.
>
> What is happening is...
> when the user hit's the button on Webform1, everything on webform1 isexactly> out and replaced by the hi res picture. The url still says
> [url]www.mysite.com/myApp/Webform1.aspx[/url]. This is all bad because (1) Webform1
> got wiped out and user needs to back arrow to continue and (2) the user
> can't save the image because the url is not a .jpg.
>
> I think this, coupled with my description below pretty much describes this
> problem I am having.
> Thanks for bearing with me so far,
> T
>
>
>
> "Jerry III" <jerryiii@hotmail.com> wrote in message
> news:OwizrFmWDHA.2880@tk2msftngp13.phx.gbl...> > Take my last message back (well, you should still clean up the page, if
> > you're sending an image then there should be no HTML for clarity).
> >
> > You're saying that the image renders fine on the client side, whatAutoEventWireup="false"> > is the problem then?
> >
> > Jerry
> >
> > "Tina" <tinamseaburn@excite.com> wrote in message
> > news:%23VAwdyhWDHA.1940@TK2MSFTNGP10.phx.gbl...> > > there are two pages involved, webform1.aspx and HiRes.aspx. In
> > > Webform1.aspx I write a .jpg to the root of d: and do :
> > > Server.Transfer("HiRes.aspx")
> > >
> > > HiRes.aspx is as follows:
> > > <%@ Page Language="vb" ContentType="image/jpeg"just> > > Codebehind="HiRes.aspx.vb" Inherits="DBAPhotoQuery.HiRes"%>
> > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > > <html>
> > > <head>
> > > <title>test</title>
> > > <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> > > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > > <meta name=vs_defaultClientScript content="JavaScript">
> > > <meta name=vs_targetSchema
> > > content="http://schemas.microsoft.com/intellisense/ie5">
> > > </head>
> > > <body MS_POSITIONING="GridLayout">
> > >
> > > <form id="Form1" target="_blank" method="post" runat="server">
> > >
> > > </form>
> > >
> > > </body>
> > > </html>
> > >
> > > and the CodeBehind for hires.aspx is as follows:
> > >
> > > Imports System.Drawing.Imaging
> > > Public Class HiRes
> > > Inherits System.Web.UI.Page
> > >
> > > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > > System.EventArgs) Handles MyBase.Load
> > > Response.Clear()
> > > Dim oBmp As Bitmap
> > > oBmp = New Bitmap("d:\bigpic.jpg")
> > > oBmp.Save(Response.OutputStream, imageformat.jpeg)
> > > Response.End()
> > > End Sub
> > > End Class
> > >
> > > What happens is that the picture does indeed get written but to
> > > webform1.aspx. What was in webform1.aspx is completely replaced byget> > the> > > image. You might notice that I put Target="_blank" in an attempt to> time> > it> > > to display a new i.e. page.
> > > Thanks,
> > > T
> > > "Jerry III" <jerryiii@hotmail.com> wrote in message
> > > news:uL66NVhWDHA.2256@TK2MSFTNGP10.phx.gbl...
> > > > What does it come as? You're clearly telling the client that it's an
> > > > image/jpeg and you're saving it as such and I'm doing this all the> more> > > and
> > > > it works just fine. Could you be more specific? Maybe you're saving> there> > right...> > > > than the image to the response or you're not setting the headers> > > >
> > > > Jerry
> > > >
> > > > "Tina" <tinamseaburn@excite.com> wrote in message
> > > > news:uzK6iwgWDHA.1900@TK2MSFTNGP10.phx.gbl...
> > > > > Natty,
> > > > > That doesn't come through to the client browser as a .jpg and is> work> > .jpg.> > > > fore
> > > > > either impossible or very difficult for them to save the file as a> > > > I
> > > > > do this all the time from static pages but can't seem to make it>> >> > > from
> > > > > aspx pages and vb.net code.
> > > > > Thanks,
> > > > > T
> > > > > "Natty Gur" <natty@dao2com.com> wrote in message
> > > > > news:e1MpZ9XWDHA.216@TK2MSFTNGP11.phx.gbl...
> > > > > > Hi,
> > > > > >
> > > > > > change the ContentType and write the jpeg.
> > > > > > Response.ContentType = "image/jepg"
> > > > > > ..
> > > > > > oBmp = New Bitmap(strPath)
> > > > > > ..
> > > > > > oBmp.Save(Response.OutputStream,
> > > > > > System.Drawing.Imaging.ImageFormat.Jpeg)
> > > > > >
> > > > > > Natty Gur, CTO
> > > > > > Dao2Com Ltd.
> > > > > > 34th Elkalay st. Raanana
> > > > > > Israel , 43000
> > > > > > Phone Numbers:
> > > > > > Office: +972-(0)9-7740261
> > > > > > Fax: +972-(0)9-7740261
> > > > > > Mobile: +972-(0)58-888377
> > > > > >
> > > > > >
> > > > > > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> > > > > > Don't just participate in USENET...get rewarded for it!
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
Jerry III Guest
-
vMike #9
Re: display new bitmap
Maybe this will help. I set the NavigateUrl in code to a aspx file which
streams the picture, but this bit puts it in a new window.
<asp:HyperLink id="zoom1" name="vlarge"
onclick="vlarge1=window.open
('','vlarge','resizable=no,scrollbars=no,status=no ,toolbar=no,height=450,wid
th=575,left=50,top=100');vlarge1.focus();return true;"
onmouseover="window.status='Click here for full sized picture.';return
true"
onmouseout="window.status=''; return true;"
text="(click here for full size)"
target="vlarge" tooltip = "Click here for full sized picture."
runat="server"/>
"Jerry III" <jerryiii@hotmail.com> wrote in message
news:OKACEEmWDHA.536@TK2MSFTNGP10.phx.gbl...Hires.aspx> Tina,
>
> this is completely wrong. You're trying to send a jpeg image fromtime> yet you're sending HTML tags to the response. If you want to do that there
> should be nothing (and I mean nothing) in the page except page directives
> and server side script. In your case (using code behind) only the single
> Page directive should be in your aspx file, like this:
>
> <%@ Page Language="vb" ContentType="image/jpeg" AutoEventWireup="false"
> Codebehind="HiRes.aspx.vb" Inherits="DBAPhotoQuery.HiRes"%>
>
> Anything else (such as your HTML in it) will be sent down to the client
> effectively breaking your jpeg image data. Of course a cleaner way is to
> send it through a render function instead of in OnLoad event but from the
> functionally point of view it doesn't matter.
>
> BTW why do you create a file on your disk drive and then send it? Wouldn't
> it be easier to send it directly without writing it to the drive?
>
> Jerry
>
>
> "Tina" <tinamseaburn@excite.com> wrote in message
> news:%23VAwdyhWDHA.1940@TK2MSFTNGP10.phx.gbl...> the> > there are two pages involved, webform1.aspx and HiRes.aspx. In
> > Webform1.aspx I write a .jpg to the root of d: and do :
> > Server.Transfer("HiRes.aspx")
> >
> > HiRes.aspx is as follows:
> > <%@ Page Language="vb" ContentType="image/jpeg" AutoEventWireup="false"
> > Codebehind="HiRes.aspx.vb" Inherits="DBAPhotoQuery.HiRes"%>
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <html>
> > <head>
> > <title>test</title>
> > <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > <meta name=vs_defaultClientScript content="JavaScript">
> > <meta name=vs_targetSchema
> > content="http://schemas.microsoft.com/intellisense/ie5">
> > </head>
> > <body MS_POSITIONING="GridLayout">
> >
> > <form id="Form1" target="_blank" method="post" runat="server">
> >
> > </form>
> >
> > </body>
> > </html>
> >
> > and the CodeBehind for hires.aspx is as follows:
> >
> > Imports System.Drawing.Imaging
> > Public Class HiRes
> > Inherits System.Web.UI.Page
> >
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> > Response.Clear()
> > Dim oBmp As Bitmap
> > oBmp = New Bitmap("d:\bigpic.jpg")
> > oBmp.Save(Response.OutputStream, imageformat.jpeg)
> > Response.End()
> > End Sub
> > End Class
> >
> > What happens is that the picture does indeed get written but to
> > webform1.aspx. What was in webform1.aspx is completely replaced by just> it> > image. You might notice that I put Target="_blank" in an attempt to get> > to display a new i.e. page.
> > Thanks,
> > T
> > "Jerry III" <jerryiii@hotmail.com> wrote in message
> > news:uL66NVhWDHA.2256@TK2MSFTNGP10.phx.gbl...> > > What does it come as? You're clearly telling the client that it's an
> > > image/jpeg and you're saving it as such and I'm doing this all themore> > and> > > it works just fine. Could you be more specific? Maybe you're savingthere> right...> > > than the image to the response or you're not setting the headers> > >
> > > Jerry
> > >
> > > "Tina" <tinamseaburn@excite.com> wrote in message
> > > news:uzK6iwgWDHA.1900@TK2MSFTNGP10.phx.gbl...
> > > > Natty,
> > > > That doesn't come through to the client browser as a .jpg and iswork> .jpg.> > > fore
> > > > either impossible or very difficult for them to save the file as a> > > I
> > > > do this all the time from static pages but can't seem to make it>> > from> >> > > > aspx pages and vb.net code.
> > > > Thanks,
> > > > T
> > > > "Natty Gur" <natty@dao2com.com> wrote in message
> > > > news:e1MpZ9XWDHA.216@TK2MSFTNGP11.phx.gbl...
> > > > > Hi,
> > > > >
> > > > > change the ContentType and write the jpeg.
> > > > > Response.ContentType = "image/jepg"
> > > > > ..
> > > > > oBmp = New Bitmap(strPath)
> > > > > ..
> > > > > oBmp.Save(Response.OutputStream,
> > > > > System.Drawing.Imaging.ImageFormat.Jpeg)
> > > > >
> > > > > Natty Gur, CTO
> > > > > Dao2Com Ltd.
> > > > > 34th Elkalay st. Raanana
> > > > > Israel , 43000
> > > > > Phone Numbers:
> > > > > Office: +972-(0)9-7740261
> > > > > Fax: +972-(0)9-7740261
> > > > > Mobile: +972-(0)58-888377
> > > > >
> > > > >
> > > > > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> > > > > Don't just participate in USENET...get rewarded for it!
> > > >
> > > >
> > >
> > >
> >
>
vMike Guest
-
Jerry III #10
Re: display new bitmap
Just use the target attribute. This approach won't work if javascript is
off, target attribute works always. Unless you want to control the windows
appearance but it's just nicer to leave that up to the user.
"vMike" <Michael.George@gewarren.com.nospam> wrote in message
news:bgn4qg$eqe$1@ngspool-d02.news.aol.com...('','vlarge','resizable=no,scrollbars=no,status=no ,toolbar=no,height=450,wid> Maybe this will help. I set the NavigateUrl in code to a aspx file which
> streams the picture, but this bit puts it in a new window.
>
> <asp:HyperLink id="zoom1" name="vlarge"
>
> onclick="vlarge1=window.open
>there> th=575,left=50,top=100');vlarge1.focus();return true;"
>
> onmouseover="window.status='Click here for full sized picture.';return
> true"
> onmouseout="window.status=''; return true;"
> text="(click here for full size)"
> target="vlarge" tooltip = "Click here for full sized picture."
> runat="server"/>
>
>
>
> "Jerry III" <jerryiii@hotmail.com> wrote in message
> news:OKACEEmWDHA.536@TK2MSFTNGP10.phx.gbl...> Hires.aspx> > Tina,
> >
> > this is completely wrong. You're trying to send a jpeg image from> > yet you're sending HTML tags to the response. If you want to do thatdirectives> > should be nothing (and I mean nothing) in the page except pagethe> > and server side script. In your case (using code behind) only the single
> > Page directive should be in your aspx file, like this:
> >
> > <%@ Page Language="vb" ContentType="image/jpeg" AutoEventWireup="false"
> > Codebehind="HiRes.aspx.vb" Inherits="DBAPhotoQuery.HiRes"%>
> >
> > Anything else (such as your HTML in it) will be sent down to the client
> > effectively breaking your jpeg image data. Of course a cleaner way is to
> > send it through a render function instead of in OnLoad event but fromWouldn't> > functionally point of view it doesn't matter.
> >
> > BTW why do you create a file on your disk drive and then send it?AutoEventWireup="false"> > it be easier to send it directly without writing it to the drive?
> >
> > Jerry
> >
> >
> > "Tina" <tinamseaburn@excite.com> wrote in message
> > news:%23VAwdyhWDHA.1940@TK2MSFTNGP10.phx.gbl...> > > there are two pages involved, webform1.aspx and HiRes.aspx. In
> > > Webform1.aspx I write a .jpg to the root of d: and do :
> > > Server.Transfer("HiRes.aspx")
> > >
> > > HiRes.aspx is as follows:
> > > <%@ Page Language="vb" ContentType="image/jpeg"just> > > Codebehind="HiRes.aspx.vb" Inherits="DBAPhotoQuery.HiRes"%>
> > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > > <html>
> > > <head>
> > > <title>test</title>
> > > <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> > > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > > <meta name=vs_defaultClientScript content="JavaScript">
> > > <meta name=vs_targetSchema
> > > content="http://schemas.microsoft.com/intellisense/ie5">
> > > </head>
> > > <body MS_POSITIONING="GridLayout">
> > >
> > > <form id="Form1" target="_blank" method="post" runat="server">
> > >
> > > </form>
> > >
> > > </body>
> > > </html>
> > >
> > > and the CodeBehind for hires.aspx is as follows:
> > >
> > > Imports System.Drawing.Imaging
> > > Public Class HiRes
> > > Inherits System.Web.UI.Page
> > >
> > > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > > System.EventArgs) Handles MyBase.Load
> > > Response.Clear()
> > > Dim oBmp As Bitmap
> > > oBmp = New Bitmap("d:\bigpic.jpg")
> > > oBmp.Save(Response.OutputStream, imageformat.jpeg)
> > > Response.End()
> > > End Sub
> > > End Class
> > >
> > > What happens is that the picture does indeed get written but to
> > > webform1.aspx. What was in webform1.aspx is completely replaced byget> > the> > > image. You might notice that I put Target="_blank" in an attempt to> time> > it> > > to display a new i.e. page.
> > > Thanks,
> > > T
> > > "Jerry III" <jerryiii@hotmail.com> wrote in message
> > > news:uL66NVhWDHA.2256@TK2MSFTNGP10.phx.gbl...
> > > > What does it come as? You're clearly telling the client that it's an
> > > > image/jpeg and you're saving it as such and I'm doing this all the> more> > > and
> > > > it works just fine. Could you be more specific? Maybe you're saving> there> > right...> > > > than the image to the response or you're not setting the headers> > > >
> > > > Jerry
> > > >
> > > > "Tina" <tinamseaburn@excite.com> wrote in message
> > > > news:uzK6iwgWDHA.1900@TK2MSFTNGP10.phx.gbl...
> > > > > Natty,
> > > > > That doesn't come through to the client browser as a .jpg and is> work> > .jpg.> > > > fore
> > > > > either impossible or very difficult for them to save the file as a> > > > I
> > > > > do this all the time from static pages but can't seem to make it>> >> > > from
> > > > > aspx pages and vb.net code.
> > > > > Thanks,
> > > > > T
> > > > > "Natty Gur" <natty@dao2com.com> wrote in message
> > > > > news:e1MpZ9XWDHA.216@TK2MSFTNGP11.phx.gbl...
> > > > > > Hi,
> > > > > >
> > > > > > change the ContentType and write the jpeg.
> > > > > > Response.ContentType = "image/jepg"
> > > > > > ..
> > > > > > oBmp = New Bitmap(strPath)
> > > > > > ..
> > > > > > oBmp.Save(Response.OutputStream,
> > > > > > System.Drawing.Imaging.ImageFormat.Jpeg)
> > > > > >
> > > > > > Natty Gur, CTO
> > > > > > Dao2Com Ltd.
> > > > > > 34th Elkalay st. Raanana
> > > > > > Israel , 43000
> > > > > > Phone Numbers:
> > > > > > Office: +972-(0)9-7740261
> > > > > > Fax: +972-(0)9-7740261
> > > > > > Mobile: +972-(0)58-888377
> > > > > >
> > > > > >
> > > > > > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> > > > > > Don't just participate in USENET...get rewarded for it!
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
Jerry III Guest
-
Tina #11
Re: display new bitmap
Again, as you can see in my example, I have target="_blank" and it does not
have any effect.
T
"Jerry III" <jerryiii@hotmail.com> wrote in message
news:utHYOqsWDHA.388@TK2MSFTNGP10.phx.gbl...image,> You need to set the target attribute to _blank on your form to open the
> image in a new window. Like this:
>
> <form target="_blank"...>...</form>
>
> Or you can use a link (<a>) with the same attribute.
>
> If I understand you correctly you don't have a problem displaying theshould> right? You just want it to open in a new window?
>
> Jerry
>
> "Tina" <tinamseaburn@excite.com> wrote in message
> news:unzRUXqWDHA.2064@TK2MSFTNGP11.phx.gbl...> > Jerry,
> > The problem is:
> > First, the desired solution is...
> > The user is interacting with Webform1.aspx. A button on that formuser> > bring up a new browser window where the url is a .jpg and the image is
> > displayed in that new browser window. Because the url is a .jpg, theWebform1> with> > can easily save it to his local disk. He can then continue interacting> wiped> > webform1, bringing up new pictures and saving them as desired.
> >
> > What is happening is...
> > when the user hit's the button on Webform1, everything on webform1 is> > out and replaced by the hi res picture. The url still says
> > [url]www.mysite.com/myApp/Webform1.aspx[/url]. This is all bad because (1)this> > got wiped out and user needs to back arrow to continue and (2) the user
> > can't save the image because the url is not a .jpg.
> >
> > I think this, coupled with my description below pretty much describesif> > problem I am having.
> > Thanks for bearing with me so far,
> > T
> >
> >
> >
> > "Jerry III" <jerryiii@hotmail.com> wrote in message
> > news:OwizrFmWDHA.2880@tk2msftngp13.phx.gbl...> > > Take my last message back (well, you should still clean up the page,7.1">> exactly> > > you're sending an image then there should be no HTML for clarity).
> > >
> > > You're saying that the image renders fine on the client side, what> AutoEventWireup="false"> > > is the problem then?
> > >
> > > Jerry
> > >
> > > "Tina" <tinamseaburn@excite.com> wrote in message
> > > news:%23VAwdyhWDHA.1940@TK2MSFTNGP10.phx.gbl...
> > > > there are two pages involved, webform1.aspx and HiRes.aspx. In
> > > > Webform1.aspx I write a .jpg to the root of d: and do :
> > > > Server.Transfer("HiRes.aspx")
> > > >
> > > > HiRes.aspx is as follows:
> > > > <%@ Page Language="vb" ContentType="image/jpeg"> > > > Codebehind="HiRes.aspx.vb" Inherits="DBAPhotoQuery.HiRes"%>
> > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > > > <html>
> > > > <head>
> > > > <title>test</title>
> > > > <meta name="GENERATOR" content="Microsoft Visual Studio .NETan> just> > > > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > > > <meta name=vs_defaultClientScript content="JavaScript">
> > > > <meta name=vs_targetSchema
> > > > content="http://schemas.microsoft.com/intellisense/ie5">
> > > > </head>
> > > > <body MS_POSITIONING="GridLayout">
> > > >
> > > > <form id="Form1" target="_blank" method="post" runat="server">
> > > >
> > > > </form>
> > > >
> > > > </body>
> > > > </html>
> > > >
> > > > and the CodeBehind for hires.aspx is as follows:
> > > >
> > > > Imports System.Drawing.Imaging
> > > > Public Class HiRes
> > > > Inherits System.Web.UI.Page
> > > >
> > > > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > > > System.EventArgs) Handles MyBase.Load
> > > > Response.Clear()
> > > > Dim oBmp As Bitmap
> > > > oBmp = New Bitmap("d:\bigpic.jpg")
> > > > oBmp.Save(Response.OutputStream, imageformat.jpeg)
> > > > Response.End()
> > > > End Sub
> > > > End Class
> > > >
> > > > What happens is that the picture does indeed get written but to
> > > > webform1.aspx. What was in webform1.aspx is completely replaced by> get> > > the
> > > > image. You might notice that I put Target="_blank" in an attempt to> > > it
> > > > to display a new i.e. page.
> > > > Thanks,
> > > > T
> > > > "Jerry III" <jerryiii@hotmail.com> wrote in message
> > > > news:uL66NVhWDHA.2256@TK2MSFTNGP10.phx.gbl...
> > > > > What does it come as? You're clearly telling the client that it'ssaving> > time> > > > > image/jpeg and you're saving it as such and I'm doing this all the> > > > and
> > > > > it works just fine. Could you be more specific? Maybe you'rea> > more> > there> > > > > than the image to the response or you're not setting the headers
> > > right...
> > > > >
> > > > > Jerry
> > > > >
> > > > > "Tina" <tinamseaburn@excite.com> wrote in message
> > > > > news:uzK6iwgWDHA.1900@TK2MSFTNGP10.phx.gbl...
> > > > > > Natty,
> > > > > > That doesn't come through to the client browser as a .jpg and is> > > > > fore
> > > > > > either impossible or very difficult for them to save the file as>> > work> > > .jpg.
> > > > > I
> > > > > > do this all the time from static pages but can't seem to make it> >> > > > from
> > > > > > aspx pages and vb.net code.
> > > > > > Thanks,
> > > > > > T
> > > > > > "Natty Gur" <natty@dao2com.com> wrote in message
> > > > > > news:e1MpZ9XWDHA.216@TK2MSFTNGP11.phx.gbl...
> > > > > > > Hi,
> > > > > > >
> > > > > > > change the ContentType and write the jpeg.
> > > > > > > Response.ContentType = "image/jepg"
> > > > > > > ..
> > > > > > > oBmp = New Bitmap(strPath)
> > > > > > > ..
> > > > > > > oBmp.Save(Response.OutputStream,
> > > > > > > System.Drawing.Imaging.ImageFormat.Jpeg)
> > > > > > >
> > > > > > > Natty Gur, CTO
> > > > > > > Dao2Com Ltd.
> > > > > > > 34th Elkalay st. Raanana
> > > > > > > Israel , 43000
> > > > > > > Phone Numbers:
> > > > > > > Office: +972-(0)9-7740261
> > > > > > > Fax: +972-(0)9-7740261
> > > > > > > Mobile: +972-(0)58-888377
> > > > > > >
> > > > > > >
> > > > > > > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> > > > > > > Don't just participate in USENET...get rewarded for it!
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
Tina Guest
-
Jerry III #12
Re: display new bitmap
Do you have this online where we could look at it?
Jerry
"Tina" <tinamseaburn@excite.com> wrote in message
news:ORRjVsZXDHA.416@tk2msftngp13.phx.gbl...not> Again, as you can see in my example, I have target="_blank" and it doesinteracting> have any effect.
> T
> "Jerry III" <jerryiii@hotmail.com> wrote in message
> news:utHYOqsWDHA.388@TK2MSFTNGP10.phx.gbl...> image,> > You need to set the target attribute to _blank on your form to open the
> > image in a new window. Like this:
> >
> > <form target="_blank"...>...</form>
> >
> > Or you can use a link (<a>) with the same attribute.
> >
> > If I understand you correctly you don't have a problem displaying the> should> > right? You just want it to open in a new window?
> >
> > Jerry
> >
> > "Tina" <tinamseaburn@excite.com> wrote in message
> > news:unzRUXqWDHA.2064@TK2MSFTNGP11.phx.gbl...> > > Jerry,
> > > The problem is:
> > > First, the desired solution is...
> > > The user is interacting with Webform1.aspx. A button on that form> user> > > bring up a new browser window where the url is a .jpg and the image is
> > > displayed in that new browser window. Because the url is a .jpg, the> > > can easily save it to his local disk. He can then continueuser> Webform1> > with> > wiped> > > webform1, bringing up new pictures and saving them as desired.
> > >
> > > What is happening is...
> > > when the user hit's the button on Webform1, everything on webform1 is> > > out and replaced by the hi res picture. The url still says
> > > [url]www.mysite.com/myApp/Webform1.aspx[/url]. This is all bad because (1)> > > got wiped out and user needs to back arrow to continue and (2) theAs> this> > > can't save the image because the url is not a .jpg.
> > >
> > > I think this, coupled with my description below pretty much describes> if> > > problem I am having.
> > > Thanks for bearing with me so far,
> > > T
> > >
> > >
> > >
> > > "Jerry III" <jerryiii@hotmail.com> wrote in message
> > > news:OwizrFmWDHA.2880@tk2msftngp13.phx.gbl...
> > > > Take my last message back (well, you should still clean up the page,> 7.1">> > exactly> > > > you're sending an image then there should be no HTML for clarity).
> > > >
> > > > You're saying that the image renders fine on the client side, what> > AutoEventWireup="false"> > > > is the problem then?
> > > >
> > > > Jerry
> > > >
> > > > "Tina" <tinamseaburn@excite.com> wrote in message
> > > > news:%23VAwdyhWDHA.1940@TK2MSFTNGP10.phx.gbl...
> > > > > there are two pages involved, webform1.aspx and HiRes.aspx. In
> > > > > Webform1.aspx I write a .jpg to the root of d: and do :
> > > > > Server.Transfer("HiRes.aspx")
> > > > >
> > > > > HiRes.aspx is as follows:
> > > > > <%@ Page Language="vb" ContentType="image/jpeg"> > > > > Codebehind="HiRes.aspx.vb" Inherits="DBAPhotoQuery.HiRes"%>
> > > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > > > > <html>
> > > > > <head>
> > > > > <title>test</title>
> > > > > <meta name="GENERATOR" content="Microsoft Visual Studio .NET> > > > > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > > > > <meta name=vs_defaultClientScript content="JavaScript">
> > > > > <meta name=vs_targetSchema
> > > > > content="http://schemas.microsoft.com/intellisense/ie5">
> > > > > </head>
> > > > > <body MS_POSITIONING="GridLayout">
> > > > >
> > > > > <form id="Form1" target="_blank" method="post" runat="server">
> > > > >
> > > > > </form>
> > > > >
> > > > > </body>
> > > > > </html>
> > > > >
> > > > > and the CodeBehind for hires.aspx is as follows:
> > > > >
> > > > > Imports System.Drawing.Imaging
> > > > > Public Class HiRes
> > > > > Inherits System.Web.UI.Page
> > > > >
> > > > > Private Sub Page_Load(ByVal sender As System.Object, ByVal eby> > > > > System.EventArgs) Handles MyBase.Load
> > > > > Response.Clear()
> > > > > Dim oBmp As Bitmap
> > > > > oBmp = New Bitmap("d:\bigpic.jpg")
> > > > > oBmp.Save(Response.OutputStream, imageformat.jpeg)
> > > > > Response.End()
> > > > > End Sub
> > > > > End Class
> > > > >
> > > > > What happens is that the picture does indeed get written but to
> > > > > webform1.aspx. What was in webform1.aspx is completely replacedto> > just> > > > the
> > > > > image. You might notice that I put Target="_blank" in an attemptit's> > get> > > > it
> > > > > to display a new i.e. page.
> > > > > Thanks,
> > > > > T
> > > > > "Jerry III" <jerryiii@hotmail.com> wrote in message
> > > > > news:uL66NVhWDHA.2256@TK2MSFTNGP10.phx.gbl...
> > > > > > What does it come as? You're clearly telling the client thatthe> an> > > > > > image/jpeg and you're saving it as such and I'm doing this allis> saving> > > time
> > > > > and
> > > > > > it works just fine. Could you be more specific? Maybe you're> > > more
> > > > > > than the image to the response or you're not setting the headers
> > > > right...
> > > > > >
> > > > > > Jerry
> > > > > >
> > > > > > "Tina" <tinamseaburn@excite.com> wrote in message
> > > > > > news:uzK6iwgWDHA.1900@TK2MSFTNGP10.phx.gbl...
> > > > > > > Natty,
> > > > > > > That doesn't come through to the client browser as a .jpg andas> > > there
> > > > > > fore
> > > > > > > either impossible or very difficult for them to save the fileit> a> > > > .jpg.
> > > > > > I
> > > > > > > do this all the time from static pages but can't seem to make>> >> > > work
> > > > > from
> > > > > > > aspx pages and vb.net code.
> > > > > > > Thanks,
> > > > > > > T
> > > > > > > "Natty Gur" <natty@dao2com.com> wrote in message
> > > > > > > news:e1MpZ9XWDHA.216@TK2MSFTNGP11.phx.gbl...
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > change the ContentType and write the jpeg.
> > > > > > > > Response.ContentType = "image/jepg"
> > > > > > > > ..
> > > > > > > > oBmp = New Bitmap(strPath)
> > > > > > > > ..
> > > > > > > > oBmp.Save(Response.OutputStream,
> > > > > > > > System.Drawing.Imaging.ImageFormat.Jpeg)
> > > > > > > >
> > > > > > > > Natty Gur, CTO
> > > > > > > > Dao2Com Ltd.
> > > > > > > > 34th Elkalay st. Raanana
> > > > > > > > Israel , 43000
> > > > > > > > Phone Numbers:
> > > > > > > > Office: +972-(0)9-7740261
> > > > > > > > Fax: +972-(0)9-7740261
> > > > > > > > Mobile: +972-(0)58-888377
> > > > > > > >
> > > > > > > >
> > > > > > > > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> > > > > > > > Don't just participate in USENET...get rewarded for it!
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
Jerry III Guest



Reply With Quote

