Bitmap::Bitmap(const Surface& surface) { width = surface.GetWidth(); height = surface.GetHeight(); format = surface.GetPixelFormat(); pitch = width * format.GetBytes(); image = new uint8[height*pitch]; // copy image CopyImage(image,surface.GetImage(),pitch,surface.GetPitch(),height); }