当相机出现在ZBar SDK中时,是否可以为焦点放置方括号? [英] Is it possible to put a square bracket for the focus when the camera appears in the ZBar SDK?

查看:135
本文介绍了当相机出现在ZBar SDK中时,是否可以为焦点放置方括号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在ZBAR SDK的相机视图中放置图像(焦点的方括号)?谁能帮助我需要做什么?谢谢

I'm trying to place an image (a square bracket for the focus) in the camera view of the ZBAR SDK? Can anyone please help me what needs to be done? thanks

推荐答案

您可以设置相机屏幕的叠加层以设置 cameraOverlayView 属性。根据您的要求设计视图并分配它:

You can set overlay of camera screen to set the cameraOverlayView property. Design a view as per your requirement and assign it:

reader.cameraOverlayView = [self CommomOverlay];

-(UIView *)CommomOverlay{
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)];

    UIImageView *TopBar = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,58)];
    [TopBar setImage:[UIImage imageNamed:@"topbar.png"]];
    [view addSubview:TopBar];

    UILabel *Toplabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 9, 300, 30)];
    [Toplabel setFont:[UIFont fontWithName:@"Arial-BoldMT" size:11]];
    [Toplabel setTextAlignment:UITextAlignmentCenter];
    [Toplabel setBackgroundColor:[UIColor clearColor]];
    [Toplabel setTextColor:[UIColor colorWithRed:76/255.0 green:76/255.0 blue:76/255.0 alpha:1.0]];
    [Toplabel setNumberOfLines:1];
    [Toplabel setText:@"Scan now "];
    [TopBar addSubview:Toplabel];

    UIImageView *FrameImg = [[UIImageView alloc] initWithFrame:CGRectMake(60,150,193,170)];
    [FrameImg setImage:[UIImage imageNamed:@"frame.png"]];
    [view addSubview:FrameImg];
    return view;
}

这篇关于当相机出现在ZBar SDK中时,是否可以为焦点放置方括号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆