小编Nad*_*net的帖子

How to set value to form control in Reactive Forms in Angular

嗨,大家好我是新手。实际上,我正在尝试从服务中订阅数据,然后将该数据传递给我的表单控件(例如,它就像一个编辑表单)。

import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormArray, FormControl } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { QuestionService } from '../shared/question.service';

@Component({
  selector: 'app-update-que',
  templateUrl: './update-que.component.html',
  styleUrls: ['./update-que.component.scss']
})
export class UpdateQueComponent implements OnInit {

  questionsTypes = ['Text Type', 'Multiple choice', 'Single Select'];
  selectedQuestionType: string = "";
  question: any = {};

  constructor(private route: ActivatedRoute, private router: Router,
    private qService: QuestionService, private fb: FormBuilder) { 

  }

  ngOnInit() {
      this.getQuebyid();
  }

  getQuebyid(){ …
Run Code Online (Sandbox Code Playgroud)

angular angular-reactive-forms angular7

12
推荐指数
4
解决办法
1万
查看次数

如何在 C# 中使用 Aforge.NET 和 ZXing.NET 从网络摄像头解码二维码

我正在尝试开发一个 WindowsForm 应用程序,它将使用网络摄像头来检测 QRCode 并解码消息。为此,我使用 AForge.NET 和 ZXing.NET。

到目前为止,我已经能够弄清楚如何从 URI 解码 QRCode,但我想从网络摄像头检测 QRCode,并对其进行解码。

以下是我的代码示例。

public String Decode(Uri uri)
{
    Bitmap image;
    try
    {
        image = (Bitmap)Bitmap.FromFile(uri.LocalPath);
    }
    catch (Exception ex)
    {
        throw new FileNotFoundException("Resource not found: " + uri);
    }

    using (image)
    {
        String text = "";
        LuminanceSource source = new BitmapLuminanceSource(image);

        BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
        Result result = new MultiFormatReader().decode(bitmap);

        if (result != null)
        {
            text = result.Text;
            return text;
        }

        text = "Provided QR couldn't be …
Run Code Online (Sandbox Code Playgroud)

c# aforge zxing

6
推荐指数
1
解决办法
5679
查看次数

如何在Android中以编程方式压缩GIF图像?

我想压缩大型 GIF 图像文件,然后再将它们发送到我的聊天应用程序的服务器(类似 WhatsApp 的功能)。

提前致谢。

android gif image-compression

5
推荐指数
0
解决办法
2237
查看次数