It seems that this is the problem of the testcase but not of my real problem.
But why can't I use an ImageBuffer as a member variable of a class? I still don't understand the actual problem.
I need a pointer to the image data so that i can manipulate it with a pointer. So I need an Image object and a pointer that that use the same area of memory. Is there another possibility if I can't use ImageBuffer?