wxGCDC(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– wxGCDC πŸ’–

okay so bestie, welcome to the Erlang module definition for wxGCDC β€” this is a device context that draws on a wxGraphicsContext. yes. she's a whole vibe. let's get into it 🫢


✨ NAME ✨

wxGCDC β€” bestie, she is a device context that draws on a wxGraphicsContext. iconic behavior honestly.


🌸 DESCRIPTION 🌸

so wxGCDC is out here doing her absolute best to implement the wxDC API, and honestly? she ate. but there are some features that are not (fully) implemented, because wxGraphicsContext simply doesn't support them, and that's just the way it is πŸ’…

  • the wxDC:getPixel/2 method is not implemented and always returns false, because modern graphics layers do not support retrieving the contents of the drawn pixels. not her fault, she's just living in the present πŸ¦‹
  • the wxDC:floodFill/4 method is not implemented, and can't be β€” like, it's literally not possible β€” because its functionality also relies on reading the pixels from wxGraphicsContext. no pixels to read, no flood to fill, periodt 😭
  • the wxDC:setLogicalFunction/2 method only works with the wxCOPY, wxOR, wxNO_OP, wxCLEAR and wxXOR functions. attempts to use any other function (including wxINVERT) do absolutely nothing. it's giving silent treatment πŸ’€
  • similarly, the ?wxRasterOperationMode parameter of wxDC:blit/6 and StretchBlit() (not implemented in wx) can only be one of the supported logical functions listed above. using any other function will result in an assertion failure and not drawing anything. so like, please don't πŸ™ˆ
  • for Direct2D-based wxGraphicsContext, only true-type fonts can be used in the font-related functions. fancy fonts, go home ✨

see also, bestie:

  • wxDC
  • wxGraphicsContext

this class is derived, and can use functions, from:

  • wxDC

wxWidgets docs: wxGCDC


πŸŽ€ DATA TYPES πŸŽ€

wxGCDC() :: wx:wx_object().

πŸ‘‘ FUNCTIONS πŸ‘‘

destroy(This :: wxGCDC()) -> ok.

Destroys the object. bye bestie, it was real πŸ˜­πŸ’œ

getGraphicsContext(This) -> wxGraphicsContext:wxGraphicsContext() when This :: wxGCDC().

Retrieves the associated wxGraphicsContext. like, she's bringing her friend along 🫢

new() -> wxGCDC().

no args, just vibes ✨

new(WindowDC) -> wxGCDC() when WindowDC :: wxWindowDC:wxWindowDC() | wxMemoryDC:wxMemoryDC() | wxGraphicsContext:wxGraphicsContext().

Constructs a wxGCDC from a wxWindowDC. slay 🌈

setGraphicsContext(This, Context) -> ok when This :: wxGCDC(), Context :: wxGraphicsContext:wxGraphicsContext().

Set the graphics context to be used for this wxGCDC.

πŸ“Œ note that this object takes ownership of context and will delete it when it is destroyed or when setGraphicsContext/2 is called again. so like, don't be out here using a context you handed over, she's got it now πŸ’…

also, unlike the constructor taking wxGraphicsContext, this method will reapply the current font, pen and brush, so that this object continues to use them, if they had been changed before (which is never the case when constructing wxGCDC directly from wxGraphicsContext). it's giving main character energy, she remembers her whole fit πŸŽ€πŸ¦‹


and that's the whole page, bestie!! much love to Ericsson AB, this is from wx 2.6, and it's the wxGCDC(3) manual page β€” go forth and draw, queen πŸ‘‘βœ¨πŸ’–

πŸ“¦ where this page comes from