Answers for "flutter custompaint image"

0

flutter custompaint image

import 'dart:ui' as ui show Image;

// Draw Class
class MyCustomPainter extends CustomPainter {
  final ui.Image myBackground;
  const MyCustomPainter(this.myBackground);

  @override
  void paint(Canvas canvas, Size size) {    
    canvas.drawImage(myBackground, Offset.zero, Paint());
  }
}

// Useses
Future<ui.Image> myBackground = await decodeImageFromList(imageFile.readAsBytes());
Posted by: Guest on October-27-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language