MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / render

Method render

src/visual/ImagePanel.cpp:25–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24
25void ImagePanel::render(wxDC& dc) {
26
27 double imagew = image.GetWidth();
28 double imageh = image.GetHeight();
29
30 wxSize destSize = dc.GetSize();
31
32 double destw = destSize.GetWidth();
33 double desth = destSize.GetHeight();
34
35 double sf, wf, hf;
36
37 wf = destw / imagew;
38 hf = desth / imageh;
39
40 sf = (wf < hf)?wf:hf;
41
42 double resulth = imageh * sf;
43 double resultw = imagew * sf;
44
45 dc.SetUserScale(sf, sf);
46 dc.DrawBitmap( image, (destw/2 - resultw/2)/sf, (desth/2 - resulth/2)/sf, false );
47}
48
49
50

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected