Clarify that wxDC::CopyAttributes() doesn't copy scaling factor
Also show an example of setting the scaling factor in wxMemoryDC documentation.
This commit is contained in:
parent
b9a84dcae5
commit
b95f2b699d
@ -1500,6 +1500,9 @@ public:
|
||||
- Background brush
|
||||
- Layout direction
|
||||
|
||||
Note that the scaling factor is not considered to be an attribute of
|
||||
wxDC and is @e not copied by this function.
|
||||
|
||||
@param dc
|
||||
A valid (i.e. its IsOk() must return @true) source device context.
|
||||
*/
|
||||
|
@ -38,6 +38,25 @@
|
||||
|
||||
This happens automatically when wxMemoryDC object goes out of scope.
|
||||
|
||||
Note that the scaling factor of the bitmap determines the scaling factor
|
||||
used by this device context, so when using a memory device context as a
|
||||
back buffer for a window, you should typically create the bitmap using the
|
||||
same scale factor as used by the window, e.g.
|
||||
@code
|
||||
void MyWindow::OnPaint(wxPaintEvent&)
|
||||
{
|
||||
wxBitmap bmp;
|
||||
bmp.CreateWithDIPSize(GetClientSize(), GetDPIScaleFactor());
|
||||
{
|
||||
wxMemoryDC memdc(bmp);
|
||||
... use memdc to draw on the bitmap ...
|
||||
}
|
||||
|
||||
wxPaintDC dc(this);
|
||||
dc.DrawBitmap(bmp, wxPoint(0, 0));
|
||||
}
|
||||
@endcode
|
||||
|
||||
@library{wxcore}
|
||||
@category{dc}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user