Asp.net parameter not valid when using bitmap

private void LoadButtonImage()
{
    if(buttonPicture != null)
        buttonPicture.Dispose();

    string templateFileName = "PicTemplate/RoundedRectangle.png";
    buttonPicture = new Bitmap(templateFileName);
}

      

This is my code ..... the parameter is not valid at runtime ... what can I do?

0


a source to share


1 answer


You are most likely pointing to the wrong location. Try switching it to



new Bitmap(Server.MapPath(templateFileName)).

      

+3


a source







All Articles