MCPcopy Create free account
hub / github.com/cogentcore/core / SetPixels

Method SetPixels

plot/plot.go:109–114  ·  view source on GitHub ↗

SetPixels sets the backing pixels image to given image.RGBA

(img *image.RGBA)

Source from the content-addressed store, hash-verified

107
108// SetPixels sets the backing pixels image to given image.RGBA
109func (pt *Plot) SetPixels(img *image.RGBA) {
110 pt.Pixels = img
111 pt.Paint = paint.NewContextFromImage(pt.Pixels)
112 pt.Paint.UnitContext.DPI = pt.DPI
113 pt.Size = pt.Pixels.Bounds().Size()
114}
115
116// Resize sets the size of the output image to given size.
117// Does nothing if already the right size.

Callers 2

ResizeMethod · 0.95
SetPlotMethod · 0.45

Calls 3

NewContextFromImageFunction · 0.92
SizeMethod · 0.65
BoundsMethod · 0.45

Tested by

no test coverage detected