如何编辑类似whatsApp的捕获图像?意味着裁剪图像,画线,在捕获的图像中添加文字,表情符号和滤镜

时间:2019-07-03 13:13:38

标签: flutter dart camera

实际上,我已经构建了自定义相机并拍摄了照片,并绘制了线条,但是我不知道如何在捕获的照片上添加表情符号,并使其可移动和缩放。

实际上我将所有表情符号都放在了字符串类型列表中,


 List<String> emojiUrls=[/*Urls of Emojis*/  ];

并将它们显示在按钮内的简单对话框中,

主体:



Stack(
        children: <Widget>[
          new  Container(  
          decoration: BoxDecoration(
            image: DecorationImage(
            image:FileImage(File(widget.imagePath)),
            fit: BoxFit.cover
          )
        ),
        child: GestureDetector(
          onPanUpdate: (DragUpdateDetails details){
            setState(() {
             RenderBox object=context.findRenderObject();
             Offset localPosition=object.globalToLocal(details.globalPosition );
             points=new List.from(points)..add(localPosition);
            });
          },
          onPanEnd: (DragEndDetails details)=>points.add(null),
          child: new CustomPaint(
            painter: new Painter(points: points),
            size:Size.infinite ,
          ),
        ),
        foregroundDecoration: BoxDecoration(
          image: DecorationImage(
            image: NetworkImage(getIndexOfStickerId)
          )
        ),
      ),
      Positioned(
        top: 0.0,
        left: 0.0,
        child: IconButton(
          icon: Icon(Icons.delete, size: 40.0,color: Colors.red,),
          onPressed: (){},
        ),
      )
    ],
   )






0 个答案:

没有答案