【问题标题】:Annotate photos using objective-c使用objective-c注释照片
【发布时间】:2015-07-08 07:36:33
【问题描述】:

我想为 iOS 应用程序的照片添加注释,我正在搜索是否存在任何可以帮助我设置基础的库。

基本上我希望实现类似的功能,如 skitch 应用程序:https://itunes.apple.com/us/app/skitch-snap.-mark-up.-send./id490505997?mt=8

我正在开发的功能要求应用程序的用户捕获图片,突出显示图片的特定区域并对其进行评论。

感谢任何有关如何进行的线索。

谢谢。

【问题讨论】:

标签: ios objective-c photo


【解决方案1】:

BugShot 的创建者 Marco Arment 开源了 BugShotKit,让开发人员可以轻松添加对注释的支持。您可以在这里查看项目https://github.com/marcoarment/BugshotKit

【讨论】:

  • 这太棒了,不幸的是,开发人员不希望它在应用商店构建中使用“请不要在应用商店构建中发布它。”
  • @IbrahimAzharArmar 您可以提取出您想要的部分,并使其在 App Store 中安全。
【解决方案2】:

试试这个,希望对你有帮助

 #pragma mark touches stuff...

    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
        UITouch *touch = [touches anyObject];
        lastTouch = [touch locationInView:imageView]; // This is your view

       }

    - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
        UITouch *touch = [touches anyObject];
        currentTouch = [touch locationInView:imageView];

        CGColorRef strokeColor = [UIColor brownColor].CGColor;
        UIGraphicsBeginImageContext(imageView.frame.size);
        CGContextRef context = UIGraphicsGetCurrentContext();
        [imageView.image drawInRect:CGRectMake(0, 0, imageView.frame.size.width, imageView.frame.size.height)];
        CGContextSetLineCap(context, kCGLineCapRound);
        CGContextSetLineWidth(context,10);

     CGContextSetStrokeColorWithColor(UIGraphicsGetCurrentContext(), [UIColor brownColor].CGColor);
                CGContextSetBlendMode(context,kCGBlendModeDarken );



        CGContextBeginPath(context);
        CGContextMoveToPoint(context, lastTouch.x, lastTouch.y);
        CGContextAddLineToPoint(context, currentTouch.x, currentTouch.y);
        CGContextStrokePath(context);
        imageView.image = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();

        lastTouch = [touch locationInView:imageView];
    }

    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
    {
        UITouch *touch = [touches anyObject];
        lastTouch = [touch locationInView:imageView];
    }

【讨论】:

    【解决方案3】:

    我浏览了 SkitchSnap 使用的所有包,这些是您应该看看的基本库: https://github.com/mattgemmell/MGImageUtilities https://github.com/coryalder/UIImage_Resize

    他们还有很多其他的库,你应该去看看。 示例:要获得灰色效果,用户登录,转换 SVG 对象,测试..

    【讨论】:

    • 谢谢,他们使用 SVG 图像并对其进行缩放是有道理的,这很有帮助,我想知道您如何了解应用程序中使用的包?
    • 他们必须包含许可证。转到设置->法律,您会找到所有这些。有一些工作可以找到代码,因为他们通常只使用软件和开发人员的名称。示例:Gabriel Handford 的 GHUnit、Nick Lockwood 于 26/01/2011 的 iRate 等。
    猜你喜欢
    • 2023-03-16
    • 2020-11-25
    • 2015-12-16
    • 2013-07-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多