Server Error in '/' Application.

A Graphics object cannot be created from an image that has an indexed pixel format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: A Graphics object cannot be created from an image that has an indexed pixel format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[Exception: A Graphics object cannot be created from an image that has an indexed pixel format.]
   System.Drawing.Graphics.FromImage(Image image) +1400440
   Pasargad.Framework.Helper.ImageHelper.AddWaterMarkImage(Image img, String watermarkPath, Int32 imgWidth, Int32 imgHeight, WaterMarkPosition position) in D:\Projects\Portal\PasargadPortal\Framework\Pasargad.Framework\Helper\ImageHelper.cs:187
   Pasargad.Web.PortalControl.Ajax.image.ProcessRequest(HttpContext context) in D:\Projects\Portal\PasargadPortal\Presentation\Pasargad.Web.PortalControl\Ajax\image.cs:76
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +790
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +88


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3650.0