I experienced the same error message and in my case the cause was the missing "bitmap.setsize' as Tom Brunberg pointed out:
Image1.Bitmap.SetSize(300, 300); // must be set before call to BeginScene