In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Description
Using wxMemoryDC rendering, you can reduce flicker, and when the rendering is complete, paste the content onto the target DC, where wxBitmap is needed as the canvas. The effect is equivalent to using wxBufferedPaintDC, but wxBufferedPaintDC is limited to use in OnPaint functions
Code
WxRect rect = GetClientRect ()
Int width = rect.GetWidth ()
Int height = rect.GetHeight ()
WxMemoryDC memDC
WxBitmap bitmap (width, height)
MemDC.SelectObject (bitmap)
MemDC.SetBackground (* wxWHITE_BRUSH)
MemDC.Clear ()
MemDC.SetPen (* wxRED_PEN)
MemDC.SetBrush (* wxRED_BRUSH)
MemDC.DrawRectangle ((wxRect (0,10, width, 100))
WxClientDC destDC (this)
DestDC.Blit (0,0
Bitmap.GetWidth (), bitmap.GetHeight ()
& memDC
0, 0
WxCOPY
True)
MemDC.SelectObject (wxNullBitmap)
A reminder
By default, the memDC background is black
WxScreenDC screen device environment
Description
WxScreenDC supports drawing graphics outside the program window and rendering in other DC, aiming at the client area of the program, not the screen. In order to map points to the screen, you need to use the ClientToScreen function to convert coordinates.
Code
WxPoint pt = ClientToScreen (GetPosition ())
Pt.x = pt.x + GetSize () .GetWidth ()
Pt.y = pt.y + GetSize () .GetHeight ()
WxSize size (100,100)
WxRect rect (pt, size)
WxScreenDC dc
Dc.SetPen (wxPen (* wxLIGHT_GREY, 2, wxSOLID))
/ / dc.SetBrush (* wxTRANSPARENT_BRUSH)
Dc.SetBrush (wxBrush (* wxBLACK))
Dc.DrawRectangle (rect)
WxClientDC wxPaintDC
Description
WxClientDC allows access to the device environment handle in the client area outside the OnPaint event, and you can see from the erase background event that wxPaintDC is in the OnPaint event
Device environment handle for internal access to the client area
Here we need to explain the client area: for a control, the size of the client area is the size of the control itself. If you customize the OnPaint event, it is only rendered within the control area. For windows, the client area does not include the title bar, menu bar, status bar and toolbars, and certainly does not include borders (this is important for dragging borders to zoom in at any time)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.