BitmapInvalidSizeException Class

Represents exception which occurs when there is not enough memory to create a bitmap instance.
Inheritance Hierarchy
SystemObject
  SystemException
    Aspose.TasksBitmapInvalidSizeException

Namespace:  Aspose.Tasks
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.10
Syntax
[SerializableAttribute]
public class BitmapInvalidSizeException : Exception

The BitmapInvalidSizeException type exposes the following members.

Constructors
  NameDescription
Protected methodCode exampleBitmapInvalidSizeException
Initializes a new instance of the BitmapInvalidSizeException class.
Properties
  NameDescription
Public propertyData (Inherited from Exception.)
Public propertyHelpLink (Inherited from Exception.)
Protected propertyHResult (Inherited from Exception.)
Public propertyInnerException (Inherited from Exception.)
Public propertyMessage (Inherited from Exception.)
Public propertySource (Inherited from Exception.)
Public propertyStackTrace (Inherited from Exception.)
Public propertyTargetSite (Inherited from Exception.)
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetBaseException (Inherited from Exception.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetObjectData (Inherited from Exception.)
Public methodGetType (Inherited from Exception.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Exception.)
Examples
Shows how to save project as an image and catch invalid size exception.
try
{
    var project = new Project(DataDir + "Blank2010.mpp");

    GanttChartView view = (GanttChartView) project.Views.ToList()[0];
    var options = new ImageSaveOptions(SaveFileFormat.PNG)
    {
        Timescale = Timescale.DefinedInView
    };

    view.MiddleTimescaleTier.Unit = TimescaleUnit.Minutes;
    view.MiddleTimescaleTier.Count = 1;

    project.Save(OutDir + "SaveToStreamAndCatchException_out.mpp", options);
}
catch (BitmapInvalidSizeException ex)
{
    Console.WriteLine(ex.Message);
}
See Also