Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

flutter ui.Image memory

$
0
0
void setPixelColor(List<Offset> points, double brushSize, Color color) {         ui.PictureRecorder recorder = ui.PictureRecorder();     ui.Canvas canvas = ui.Canvas(recorder); canvas.drawImage(layers[currentEditLayout].uiImage!, Offset.zero, Paint());    canvas.drawPoints(        ui.PointMode.points,        points,        Paint()          ..color = color          ..strokeWidth = 1);    ui.Picture picture = recorder.endRecording();    layers[currentEditLayout].uiImage!.dispose();    layers[currentEditLayout].uiImage = null;    layers[currentEditLayout].uiImage = picture.toImageSync(canvasSize.width.toInt(),canvasSize.height.toInt());    picture.dispose();}

I tried to run this function inside a for loop, but the memory was growing badly. I expect stable running memory


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>