2016-12-16 1 views
0

私のアプリケーションでは、3つの画像がありますが、正しい結果が表示されません。私は縦に私はコードどうすれば正しくasp.netで画像を表示できますか

using (Bitmap FinalBitmap = new Bitmap(Math.Max(img3.Width, Math.Max(img1.Width, img2.Width)),img1.Height + img2.Height + img3.Height)) 
{ 
       using (Graphics FinalImage = Graphics.FromImage(FinalBitmap)) 
       { 
        // Draw the first image staring at point (0,0) with actual width and height of the image, in final image 
        FinalImage.DrawImage(img1, new Rectangle(0, 0, img1.Width, img1.Height));     
        // and Draw the second image staring at point where first image ends in the final image and save changes 
        FinalImage.DrawImage(img2, 0, img1.Height);     
        FinalImage.DrawImage(img3, 0,img2.Height); 

        FinalImage.Save(); 


       } 
     } 

は、作成長方形がすべての画像オフの高さである必要があなたに

答えて

0

に感謝しようとしたシングルに3枚の画像を表示する必要があります。 Img1.Height + img2.Height + img3.height

あなたがimg1.height + img2.height

+0

の時点で開始する必要がある最後の画像を描画するときは、IMG1とIMG2の高さを追加しようとしましたあなたが最後のイメージを描くとき? FinalImage.DrawImage(img3、0、img2.Height + img1.Height); –

+0

ありがとう、それは働いている –

関連する問題