Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
Oblivion is currently offline  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


[Updated on: Sat, 08 July 2023 12:10]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mouse Interaction with UI causes Paint to not function
Next Topic: Option Label on Left Side draw
Goto Forum:
  


Current Time: Sun Jul 06 11:34:53 CEST 2025

Total time taken to generate the page: 0.03632 seconds