我菜固我在

博客园 首页 新随笔 联系 订阅 管理
图片显示页面(MyImg.aspx)后台代码:

private void Page_Load(object sender, System.EventArgs e)
        
{
            
// 在此处放置用户代码以初始化页面
            if(!Page.IsPostBack)
            
{
                ChangImg();
            }

        }

        
private void ChangImg()
        
{
            
string strFilename=string.Empty;
            System.Drawing.Image  oldImg;
            ImageAttributes ia
=new ImageAttributes();
            strFilename 
= Server.MapPath("img/"+Request.QueryString["filename"]);
            oldImg 
= System.Drawing.Image.FromFile(strFilename);
            Graphics g 
= System.Drawing.Graphics.FromImage(oldImg);                

            
亮度和对比度
            
if(Request.QueryString["ring"]!=null)
            
{
                
//旋转
            }

                
            oldImg.Save(Response.OutputStream,System.Drawing.Imaging.ImageFormat.Jpeg);
            g.Dispose();
            ia.Dispose();
            oldImg.Dispose();
        }

        
private System.Drawing.Image ChangImgBrCon(System.Drawing.Image oldImg,System.Drawing.Image newImg)
        
{
            
return null;
        }

        
private float[][] Multiply(float[][] f1, float[][] f2)
        
{
            
//合并
            float[][] X = new float[5][];
            
for (int d = 0; d < 5; d++)
                X[d] 
= new float[5];
            
int size = 5;
            
float[] column = new float[5];
            
for (int j = 0; j < 5; j++)
            
{
                
for (int k = 0; k < 5; k++)
                
{
                    column[k] 
= f1[k][j];
                }

                
for (int i = 0; i < 5; i++)
                
{
                    
float[] row = f2[i];
                    
float s = 0;
                    
for (int k = 0; k < size; k++)
                    
{
                        s 
+= row[k] * column[k];
                    }

                    X[i][j] 
= s;
                }
 
            }

            
return X;
        }
posted on 2004-12-23 10:11  大侠(cer)  阅读(736)  评论(0编辑  收藏  举报