System.IO.FileStream newFile= new System.IO.FileStream(_SavePath + sFilename, System.IO.FileMode.Create);
newFile.Write(myData,0, myData.Length);
newFile.Close();
this.m_BigImgName=sFilename; if(!flag)
{
m_Err=1;
return;
}
string SmallImgPath=_SavePath+"small\\";
if(!System.IO.Directory.Exists(SmallImgPath))
System.IO.Directory.CreateDirectory(SmallImgPath);
System.Drawing.Image.GetThumbnailImageAbort myCallBack = 
new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);
Bitmap myBitmap;
try
{
myBitmap = new Bitmap(_SavePath+ sFilename);
file_append = 0;
string sThumbFile = System.IO.Path.GetFileNameWithoutExtension(m_UpFile.FileName)
+ sThumbExtension + ".gif";
while (System.IO.File.Exists(SmallImgPath + sThumbFile))
{
file_append++;
sThumbFile = System.IO.Path.GetFileNameWithoutExtension(m_UpFile.FileName) + 
file_append.ToString() + sThumbExtension + ".gif";
} // 保存小图片
System.Drawing.Image myThumbnail= myBitmap.GetThumbnailImage(ThumbWidth, 
ThumbHeight, myCallBack, IntPtr.Zero);
myThumbnail.Save(SmallImgPath + sThumbFile); this.m_SmallImgName=sThumbFile; myThumbnail.Dispose();
myBitmap.Dispose();
}
catch //(ArgumentException errArgument)
{

m_Err=-3;
System.IO.File.Delete(_SavePath + sFilename);
}

解决方案 »

  1.   

    try:         Image img=Image.FromFile(@"g:\图片\ffx203.jpg");
    Bitmap bmp=new Bitmap(img,150,150);
    bmp.Save(@"c:\123.jpg")
      

  2.   

    Bitmap map=new Bitmap(Server.MapPath("./upimg/102935.gif"));
    Bitmap map1=(Bitmap) map.GetThumbnailImage(100,150,null,IntPtr.Zero);
    try
    {
    map1.Save("c:\\0.gif",System.Drawing.Imaging.ImageFormat.Gif);
    }
    catch(Exception ex)
    {
    error1.InnerHtml=ex.Message;
    }
      

  3.   

    是可以了,我做的gif不是动画了。谁有法。不知道 windinwing(潇笑) ( ) 信誉:72  2004-09-25 19:38:00  得分: 0  
     
    可不可以的。我不太明白。请给讲一下好吗?
      

  4.   


    这个问题挺难,你得对GIF文件的格式非常清楚才行!