BitmapInvalidSizeException Class |
Represents exception which occurs when there is not enough memory to create a bitmap instance.
Inheritance Hierarchy
Namespace:
Aspose.Tasks
Assembly:
Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.10
Syntax[SerializableAttribute]
public class BitmapInvalidSizeException : Exception
<SerializableAttribute>
Public Class BitmapInvalidSizeException
Inherits Exception
[SerializableAttribute]
public ref class BitmapInvalidSizeException : public Exception
[<SerializableAttribute>]
type BitmapInvalidSizeException =
class
inherit Exception
end
The BitmapInvalidSizeException type exposes the following members.
Constructors
Properties
Methods
ExamplesShows 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