c# - 使用 protobuf 将类型 System.Drawing.Rectangle 从 .Net 序列化为 C++

标签 c# c++ objective-c protobuf-net

如果我在 C# 中序列化(使用 protobuf)一个矩形 (System.Drawing.Rectangle),是否可以在 Objective-C 或 C++ 中反序列化它,因为 System.Drawing.Rectangle 不是像 int 这样的常见类型。

如果可能的话,在 C++ 或 Objective-C 中获得这个矩形的最佳方法是什么?

最佳答案

我通过使用我自己的类类型来修复它,我的意思是通过将 System.Drawing.Rectangle 替换为我自己的类而不包含相同的属性。

我的意思是如果你想序列化和反序列化你必须使用通用类型。

关于c# - 使用 protobuf 将类型 System.Drawing.Rectangle 从 .Net 序列化为 C++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21349349/

相关文章:

c# - 使用 C# 进行 JSON-RPC HTTP 调用

c# - 为什么 Animals[] animals = new Cat[5] 编译,但 List<Animal> animals = new List<Cat>() 不编译?

c# - 静态类型不能用作参数

c++ - 尾随返回类型中的占位符是否会覆盖初始占位符?

c++ - Vtable 是否仅与指向基类的指针一起使用

python - 套接字火箭(iOS): How to identify whom user are chatting with another?

c# - C# 中十进制类型的解析意外失败

C++优先队列,逻辑错误,想不通

iphone - 如何在iOS中实现类似安卓手机(默认)的裁剪功能?

ios - 将字符串转换为日期并查找时差