TMemoryImagePtr::WriteMemoryImageWithDerivedType