1

ここからテンプレートをダウンロードしました

私はXCode 4.6を持っています。実行すると、次のようになりました。

 + (UIImage *)imageWithCVMat:(const cv::Mat&)cvMat orientation:(UIImageOrientation)orientation
{
    return [[UIImage alloc] initWithCVMat:cvMat orientation:orientation];
}

+ (UIImage *)imageWithCVMat:(const cv::Mat&)cvMat
{
    return [[UIImage alloc] initWithCVMat:cvMat orientation:0];
}

そして私はエラーを得ました

Cannot initialize a parameter of type 'UIImageOrientation' with an value of type 'int'

どうすれば解決できますか?多分誰でも知ってる

4

2 に答える 2

1

エラーは0、2番目の簡易メソッドで値を使用することに関するものです

何も指定されていない場合のデフォルトの向きを選択してください

+ (UIImage *)imageWithCVMat:(const cv::Mat&)cvMat {
     return [[UIImage alloc] initWithCVMat:cvMat orientation:UIImageOrientationUp]; 
}
于 2013-02-26T14:27:04.023 に答える
0

この方法

+ (UIImage *)imageWithCVMat:(const cv::Mat&)cvMat
{
return [[UIImage alloc] initWithCVMat:cvMat orientation:0];
}

orientation:0タイプのオブジェクトが必要なため、持つことはできませんUIImageOrientation。多分それを作ってみるかnil(それが許可されているかどうかわからない)、新しいデフォルトの UIImageOrientation を与えてください

于 2013-02-26T14:24:18.257 に答える