Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Font and Image rendering slow
Re: Font and Image rendering slow [message #60011 is a reply to message #60010] |
Sat, 08 July 2023 11:44   |
Oblivion
Messages: 1214 Registered: August 2007
|
Senior Contributor |
|
|
Quote:Now the final problem I am not seeing how to fix though since everything is direct to the Upp::Draw in the main paint section is how to do a full screen transparency effect.
I might be getting you wrong here, but do you mean this? (If you mean window background transparency effect, there is no direct method for that in Upp, not that I know of, at least)
void frm_main::Paint(Draw& w) {
Size sz = GetSize();
w.DrawRect(sz, Yellow()); // System draw, background = yellow.
ImageBuffer ib(sz);
BufferPainter bp(ib, MODE_ANTIALIASED);
bp.Clear(RGBAZero()); // Buffer now has transparent background.
_icons_paint(bp, scroll.Get().x, scroll.Get().y, allow_scaling, render_everything);
if(show_overlay) {
_paint_overlay(bp);
}
SetSurface(w, 0, 0, sz.cx, sz.cy, ~ib); // You need to use SetSurface to directly paint buffer content here (this is optimized for systemdraw (possibly faster than usual image drawing) ...
}
Also, IMO, the optimized way of painting a large painter object is, drawing it in another thread, in parallel -if possible- and only update the system draw -using SetSurface- as needed. (If there is no strict requirement on doing all the work in single-threaded environment, I mean.)
Further note: You can use also use ImagePainter class instead of using a ImageBuffer + BufferPainter. ImagePainter is basically a wrapper for BufferPainter + ImageBuffer.
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Sat, 08 July 2023 12:10] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Jul 06 11:34:53 CEST 2025
Total time taken to generate the page: 0.03632 seconds
|