convert bitmap to image for ASP.NET

前端 未结 6 1551
无人及你
无人及你 2021-01-24 23:16

this is how my code look now:

System.Drawing.Image objImage = System.Drawing.Image.FromFile(Server.MapPath(\"aaa.jpg\"));

int height = objImage.Height;
int widt         


        
6条回答
  •  -上瘾入骨i
    2021-01-25 00:06

    You can also try:

    imgBig.ImageUrl = ResolveUrl(saveImagePath);
    

    EDIT:

    If saveImagePath is under the WebApplication Directory, doing some modifications on the directory structure i.e. modifying files, deleting and creating can cause the application pool to recycle, and once it reaches the maximum recycle count the application pool will be stopped causing "Server unavailable" error.

    I would suggests to add/save/modify images on a separate directory (not under the Apps Directory) then create a Handler(ASHX) that will read the images, just an advice though.

提交回复
热议问题