SetPixels sets the backing pixels image to given image.RGBA
(img *image.RGBA)
| 107 | |
| 108 | // SetPixels sets the backing pixels image to given image.RGBA |
| 109 | func (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. |
no test coverage detected