wxBufferedPaintDC(3erl)
okay so bestie, welcome to wxBufferedPaintDC(3erl) β an Erlang Module Definition and honestly the double-buffer glow-up you didnβt know you needed. π
β¨
πΈ NAME πΈ
wxBufferedPaintDC β Functions for wxBufferedPaintDC class. periodt.
π¦ DESCRIPTION π¦
okay so this is a subclass of wxBufferedDC, and you can use it inside an EVT_PAINT() event handler to achieve double-buffered drawing. Just use this class instead of wxPaintDC, and make sure wxWindow:setBackgroundStyle/2 is called with wxBG_STYLE_PAINT somewhere in the class initialization code β and thatβs literally all you have to do to (mostly) avoid flicker. π
The only thing to watch out for is that if you are using this class together with wxScrolled (not implemented in wx), you probably do not want to call wxScrolledWindow:prepareDC/2 on it, as it already does this internally for the real underlying wxPaintDC. π«Ά
- See:
wxDC,wxBufferedDC,wxAutoBufferedPaintDC(not implemented in wx),wxPaintDC.
This class is derived (and can use functions) from: wxBufferedDC, wxMemoryDC, wxDC.
wxWidgets docs: wxBufferedPaintDC.
π§ DATA TYPES π§
wxBufferedPaintDC() = wx:wx_object()
π EXPORTS π
new(Window) -> wxBufferedPaintDC()Types:Window = wxWindow:wxWindow()
new(Window, Buffer) -> wxBufferedPaintDC()new(Window, Buffer :: [Option]) -> wxBufferedPaintDC()Types:Window = wxWindow:wxWindow()Option = {style, integer()}
new(Window, Buffer, Options :: [Option]) -> wxBufferedPaintDC()Types:Window = wxWindow:wxWindow()Buffer = wxBitmap:wxBitmap()Option = {style, integer()}
As with wxBufferedDC, you may either provide the bitmap to be used for buffering or let this object create one internally (in the latter case, the size of the client part of the window is used). π¨
Pass wxBUFFER_CLIENT_AREA for the style parameter to indicate that just the client area of the window is buffered, or wxBUFFER_VIRTUAL_AREA to indicate that the buffer bitmap covers the virtual area. π
destroy(This :: wxBufferedPaintDC()) -> okβ Copies everything drawn on the DC so far to the window associated with this object, using awxPaintDC. π«Ά
Huge kiss to the wxWidgets team β this page is from wx 2.2.2.1, and itβs the wxBufferedPaintDC(3erl) manual. Byeee! ππ¦
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms