diff --git a/CADability.Forms/CadCanvas.cs b/CADability.Forms/CadCanvas.cs
index b37d6969..b9cb90f1 100644
--- a/CADability.Forms/CadCanvas.cs
+++ b/CADability.Forms/CadCanvas.cs
@@ -51,7 +51,9 @@ private static CADability.Substitutes.PaintEventArgs Subst(System.Windows.Forms.
return new Substitutes.PaintEventArgs()
{
ClipRectangle = v.ClipRectangle,
+#pragma warning disable CS0618 // still set for views of applications that read it, until CADability 2.0
Graphics = v.Graphics
+#pragma warning restore CS0618
};
}
private IView view;
diff --git a/CADability/FormsSubst.cs b/CADability/FormsSubst.cs
index 7af57951..160686e3 100644
--- a/CADability/FormsSubst.cs
+++ b/CADability/FormsSubst.cs
@@ -74,6 +74,11 @@ public KeyEventArgs(Keys keyData)
public class PaintEventArgs
{
public Rectangle ClipRectangle { get; set; }
+ ///
+ /// The GDI+ graphics of the paint event. No view of CADability reads it: views paint through
+ /// .
+ ///
+ [Obsolete("No view of CADability uses it. Paint through ICanvas.PaintTo3D instead. GDI+ is removed from the kernel in CADability 2.0 (issue #412).")]
public Graphics Graphics { get; set; }
}
diff --git a/CADability/ModelView.cs b/CADability/ModelView.cs
index 1cda0368..b0969768 100644
--- a/CADability/ModelView.cs
+++ b/CADability/ModelView.cs
@@ -3013,6 +3013,7 @@ public void Scroll(int HScrollOffset, int VScrollOffset)
/// Not implemented: always returns null. Kept for compatibility with earlier versions.
///
/// null
+ [Obsolete("Not implemented, always returns null. Use CADability.Forms.PaintToOpenGL.PaintToBitmap to render the model into a bitmap. GDI+ is removed from the kernel in CADability 2.0 (issue #412).")]
public Bitmap GetContentsAsBitmap()
{
{
diff --git a/CADability/PaintToOpenGl.cs b/CADability/PaintToOpenGl.cs
index ebd01fe3..30c8b771 100644
--- a/CADability/PaintToOpenGl.cs
+++ b/CADability/PaintToOpenGl.cs
@@ -657,6 +657,7 @@ internal static void InvokeSetProjection(IntPtr renderContext, IPaintTo3D paintT
/// of the bitmap
/// the extent to show in the bitmap; if null, the extent of the objects is used
///
+ [Obsolete("Not implemented in the kernel, always throws a NotImplementedException. Use CADability.Forms.PaintToOpenGL.PaintToBitmap with the same parameters instead. GDI+ is removed from the kernel in CADability 2.0 (issue #412).")]
public static Bitmap PaintToBitmap(GeoObjectList list, GeoVector viewDirection, int width, int height, BoundingCube? extent = null)
{
throw new NotImplementedException("PaintToBitmap not implemented, maybe implement in CADability.Forms");