ZBar SDK中出现相机时是否可以为焦点加上方括号?

发布于 2024-12-18 19:03:00 字数 52 浏览 1 评论 0原文

我正在尝试在 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

べ繥欢鉨o。 2024-12-25 19:03:00

您可以通过设置 cameraOverlayView 属性来设置相机屏幕的覆盖。根据您的要求设计视图并分配它:

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;
}

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;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文