MCPcopy Create free account
hub / github.com/audacity/audacity / CreateBackground

Function CreateBackground

libraries/lib-theme/ImageManipulation.cpp:266–285  ·  view source on GitHub ↗

Creates an image with a solid background color

Source from the content-addressed store, hash-verified

264
265// Creates an image with a solid background color
266std::unique_ptr<wxImage> CreateBackground(int width, int height, wxColour colour)
267{
268 auto i = std::make_unique<wxImage>(width, height);
269 unsigned char *ip;
270 int srcVal[3];
271 int x;
272
273 srcVal[0] = colour.Red();
274 srcVal[1] = colour.Green();
275 srcVal[2] = colour.Blue();
276
277 ip = i->GetData();
278 for(x=0; x<width*height; x++) {
279 *ip++ = srcVal[0];
280 *ip++ = srcVal[1];
281 *ip++ = srcVal[2];
282 }
283
284 return i;
285}
286
287std::unique_ptr<wxImage> CreateSysBackground
288 (int width, int height, int WXUNUSED(offset), wxColour colour)

Callers 1

CreateSysBackgroundFunction · 0.85

Calls 1

GetDataMethod · 0.45

Tested by

no test coverage detected