Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   about image rotating (http://www.velocityreviews.com/forums/t621917-about-image-rotating.html)

Michael 06-24-2008 01:51 AM

about image rotating
 
Hello all, how could I rotate a server side image in asp.net and show it in
web page? Thanks.


Nathan Sokalski 06-24-2008 03:39 AM

Re: about image rotating
 
Well, I'm not going to write the whole function for you, but you basically
need to create an *.aspx page that returns an image/gif. In the Load event,
you will simply use the classes in the System.Drawing namespace to rotate
it. If you have never created an *.aspx that returns an image/gif, you
basically use the Save() method of a Bitmap to output the image to the
Response.OutputStream like the following:

mybitmap.Save(Response.OutputStream, ImageFormat.Gif)

I'm not going to going into the other details of the steps you will need to
take, but most of them are reasonably simple, and if you can find a good
website I think you'll be able to figure it out. Good Luck!
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

"Michael" <Michael_MSDN@noemail.noemail> wrote in message
news:OKFdbzZ1IHA.3920@TK2MSFTNGP02.phx.gbl...
> Hello all, how could I rotate a server side image in asp.net and show it
> in web page? Thanks.




Steven Cheng [MSFT] 06-24-2008 03:48 AM

RE: about image rotating
 
Hi Michael,

From your description, you're wantting to display some image files(at
server-side) as rotated format on ASP.NET web page, correct?

If so, I think the proper means is use the .NET GDI+ classes to perform
transforming on the certain images. You can generate an rotated image
stream and output it on page(via an httphander or page...)

Here are some good web articles which has introduced some code and examples
on GDI+ image transformation:

#Matrix Transformation of Images in C#, using .NET GDI+
http://www.codeproject.com/KB/GDI-pl...formation.aspx

#Image Transformation in C# with GDI+
http://www.c-sharpcorner.com/UploadF...04121920050548
03AM/Transformations04.aspx

#NET and GDI+: Transforming Images on the Server - Introduction and
Examples, Part II...
http://www.dotnetjohn.com/articles.aspx?articleid=115

Also, if you're not familar with emiting image stream via httphandler in
ASP.NET, here are some tech articles on this:

http://www.codeproject.com/KB/web-im...umbnailer.aspx

http://www.c-sharpcorner.com/UploadF...rImages1115200
5062705AM/HTTPHandlersForImages.aspx

http://msdn.microsoft.com/en-us/magazine/cc163988.aspx

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
>Reply-To: "Michael" <Michael_MSDN@noemail.noemail>
>From: "Michael" <Michael_MSDN@noemail.noemail>
>Subject: about image rotating
>Date: Tue, 24 Jun 2008 09:51:42 +0800


>
>Hello all, how could I rotate a server side image in asp.net and show it

in
>web page? Thanks.
>
>



densial 06-24-2008 04:31 AM

Re: about image rotating
 
On Jun 24, 3:48 pm, stch...@online.microsoft.com (Steven Cheng [MSFT])
wrote:
> Hi Michael,
>
> From your description, you're wantting to display some image files(at
> server-side) as rotated format on ASP.NET web page, correct?
>
> If so, I think the proper means is use the .NET GDI+ classes to perform
> transforming on the certain images. You can generate an rotated image
> stream and output it on page(via an httphander or page...)
>
> Here are some good web articles which has introduced some code and examples
> on GDI+ image transformation:
>
> #Matrix Transformation of Images in C#, using .NET GDI+http://www.codeproject.com/KB/GDI-pl...formation.aspx
>
> #Image Transformation in C# with GDI+http://www.c-sharpcorner.com/UploadF...mations0412192...
> 03AM/Transformations04.aspx
>
> #NET and GDI+: Transforming Images on the Server - Introduction and
> Examples, Part II...http://www.dotnetjohn.com/articles.aspx?articleid=115
>
> Also, if you're not familar with emiting image stream via httphandler in
> ASP.NET, here are some tech articles on this:
>
> http://www.codeproject.com/KB/web-im...umbnailer.aspx
>
> http://www.c-sharpcorner.com/UploadF...dlersForImages...
> 5062705AM/HTTPHandlersForImages.aspx
>
> http://msdn.microsoft.com/en-us/magazine/cc163988.aspx
>
> Hope this helps.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msd...@microsoft.com.
>
> ==================================================
> Get notification to my posts through email? Please refer tohttp://msdn.microsoft.com/subscriptions/managednewsgroups/default.asp...
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) athttp://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> --------------------
>
>
>
> >Reply-To: "Michael" <Michael_M...@noemail.noemail>
> >From: "Michael" <Michael_M...@noemail.noemail>
> >Subject: about image rotating
> >Date: Tue, 24 Jun 2008 09:51:42 +0800

>
> >Hello all, how could I rotate a server side image in asp.net and show it

> in
> >web page? Thanks.


if you just want to rotate or flip it by the standard 90/180/270 then
you could try

System.Drawing.Image image =
System.Drawing.Image.FromFile(fileInPath);
image.RotateFlip(RotateFlipType.xxxxx);
image.Save(fileOutPath)

Michael 06-24-2008 07:34 AM

Re: about image rotating
 
Thanks to everyone's response and informaton. Image.RotateFlip resolved the
issue.

"densial" <densial@gmail.com> wrote in message
news:89c6aa52-90b4-4058-946a-ae55fd2260ad@i18g2000prn.googlegroups.com...
> On Jun 24, 3:48 pm, stch...@online.microsoft.com (Steven Cheng [MSFT])
> wrote:
>> Hi Michael,
>>
>> From your description, you're wantting to display some image files(at
>> server-side) as rotated format on ASP.NET web page, correct?
>>
>> If so, I think the proper means is use the .NET GDI+ classes to perform
>> transforming on the certain images. You can generate an rotated image
>> stream and output it on page(via an httphander or page...)
>>
>> Here are some good web articles which has introduced some code and
>> examples
>> on GDI+ image transformation:
>>
>> #Matrix Transformation of Images in C#, using .NET
>> GDI+http://www.codeproject.com/KB/GDI-pl...formation.aspx
>>
>> #Image Transformation in C# with
>> GDI+http://www.c-sharpcorner.com/UploadF...mations0412192...
>> 03AM/Transformations04.aspx
>>
>> #NET and GDI+: Transforming Images on the Server - Introduction and
>> Examples, Part II...http://www.dotnetjohn.com/articles.aspx?articleid=115
>>
>> Also, if you're not familar with emiting image stream via httphandler in
>> ASP.NET, here are some tech articles on this:
>>
>> http://www.codeproject.com/KB/web-im...umbnailer.aspx
>>
>> http://www.c-sharpcorner.com/UploadF...dlersForImages...
>> 5062705AM/HTTPHandlersForImages.aspx
>>
>> http://msdn.microsoft.com/en-us/magazine/cc163988.aspx
>>
>> Hope this helps.
>>
>> Sincerely,
>>
>> Steven Cheng
>>
>> Microsoft MSDN Online Support Lead
>>
>> Delighting our customers is our #1 priority. We welcome your comments and
>> suggestions about how we can improve the support we provide to you.
>> Please
>> feel free to let my manager know what you think of the level of service
>> provided. You can send feedback directly to my manager at:
>> msd...@microsoft.com.
>>
>> ==================================================
>> Get notification to my posts through email? Please refer
>> tohttp://msdn.microsoft.com/subscriptions/managednewsgroups/default.asp...
>> ications.
>>
>> Note: The MSDN Managed Newsgroup support offering is for non-urgent
>> issues
>> where an initial response from the community or a Microsoft Support
>> Engineer within 1 business day is acceptable. Please note that each
>> follow
>> up response may take approximately 2 business days as the support
>> professional working with you may need further investigation to reach the
>> most efficient resolution. The offering is not appropriate for situations
>> that require urgent, real-time or phone-based interactions or complex
>> project analysis and dump analysis issues. Issues of this nature are best
>> handled working with a dedicated Microsoft Support Engineer by contacting
>> Microsoft Customer Support Services (CSS)
>> athttp://msdn.microsoft.com/subscriptions/support/default.aspx.
>> ==================================================
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> --------------------
>>
>>
>>
>> >Reply-To: "Michael" <Michael_M...@noemail.noemail>
>> >From: "Michael" <Michael_M...@noemail.noemail>
>> >Subject: about image rotating
>> >Date: Tue, 24 Jun 2008 09:51:42 +0800

>>
>> >Hello all, how could I rotate a server side image in asp.net and show it

>> in
>> >web page? Thanks.

>
> if you just want to rotate or flip it by the standard 90/180/270 then
> you could try
>
> System.Drawing.Image image =
> System.Drawing.Image.FromFile(fileInPath);
> image.RotateFlip(RotateFlipType.xxxxx);
> image.Save(fileOutPath)




All times are GMT. The time now is 10:29 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.