您现在的位置是:首页 >

ASP技术 ASP.NET图象处理详解(3)

火烧 2022-06-17 00:05:50 1045
ASP.NET图象处理详解 3 三 画图特效  如果只是将图片显示在网页上 这样未免显得简单 现在 我们来进一步感受ASP NET的强大功能 我们将学习图象处理中常用的图象反转 图象切割 图象拉伸等技

ASP.NET图象处理详解(3)  

ASP技术 ASP.NET图象处理详解(3)
三 画图特效  如果只是将图片显示在网页上 这样未免显得简单 现在 我们来进一步感受ASP NET的强大功能 我们将学习图象处理中常用的图象反转 图象切割 图象拉伸等技巧    先来看看程序效果     仔细看 我们可以找到各种图象处理效果 现在 我们来看看程序代码   <%@ Page Language= vb Debug= True %>   <%@ import namespace= system drawing %>   <%@ import namespace= system drawing imaging %>   <%@ import namespace= system drawing drawing d %>   <%   dim strFilename as string   dim i as System Drawing Image   strFilename = server mappath( /chris fsck jpg )  i = System Drawing Image FromFile(strFilename)  dim b as New system drawing bitmap(i width i height pixelformat format bpprgb)   dim g as graphics = graphics fromimage(b)  g clear(color blue)   旋转图片   i RotateFlip(System Drawing RotateFlipType Rotate FlipX)   g drawimage(i New point( ))   i RotateFlip(System Drawing RotateFlipType Rotate FlipY)  g RotateTransform( )   g drawimage(i New point( ))   g RotateTransform( )   g drawimage(i New point( ))   g RotateTransform( )   g drawimage(i New point( ))   g RotateTransform( )   g drawimage(i New point( ))   g RotateTransform( )   g RotateTransform( )   g drawimage(i New rectangle( ) New rectangle( i width i height ) GraphicsUnit Pixel)   g RotateTransform( )   拉伸图片   g drawimage(i New rectangle( ) New rectangle( i width i height ) GraphicsUnit Pixel)   g drawimage(i New rectangle( ) New rectangle( i width i height ) GraphicsUnit Pixel)   g drawimage(i New rectangle( ) New rectangle( i width i height ) GraphicsUnit Pixel)   切割图片   g drawimage(i New rectangle( ) GraphicsUnit Pixel)   g drawimage(i New rectangle( ) GraphicsUnit Pixel)   旋转图片   i RotateFlip(System Drawing RotateFlipType Rotate FlipX)   g drawimage(i New rectangle( ) GraphicsUnit Pixel)  ntenttype= image/jpeg   b save(response outputstream imageformat jpeg)  b dispose()  %>  在以上的程序中 我们看到实现图象处理的各种技巧 仔细观察 我们可以知道旋转图片其实是用了一个RotateFlip方法 而切割和拉伸图片 完全是通过设置DrawImage的不同参数来实现   四 总结  ASP NET的图象处理可以实现的功能很多 我们在这里其实只是简单的介绍 更多功能的应用 需要我们在实践中摸索 总结 lishixinzhi/Article/program/net/201311/13345  
永远跟党走
  • 如果你觉得本站很棒,可以通过扫码支付打赏哦!

    • 微信收款码
    • 支付宝收款码