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 » Painter bug?
Re: Painter bug? [message #31548 is a reply to message #31540] Sat, 12 March 2011 22:14 Go to previous messageGo to previous message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Thank you for the replies. The problem is clear now.
Currently I see the only solution, and I'm not really shure you want it. Smile
Anyway. We could use temporary surface which stores color + alpha for a sequence of operations. On writing a pixel, it's color is calculated in usual way, but alpha is added to the current alpha value. E.g. we will have alpha = 256 in previous Mirek's example. Rendering this temporary surface to actual image will give solid black color which is absolutely right result.
This could look like this:
painter
    .BeginComplex()
    ./*draw polygon 1*/
    ./*fill polygon 1*/
    ./*draw polygon 2*/
    ./*fill polygon 2*/
    ./*draw polygon 3*/
    ./*fill polygon 3*/
    .EndComplex()
;


UPDATE: OK, here is quick and dirty "back-end" solution. Let's imagine we draw polygons in scaled coordinates:
painter.Scale(scale);
To avoid polygon stitching you may simply move polygon adjacent vertices with 0.5/scale towards neighbouring polygon, i.e.
painter.Move(x[i]+.5/scale,y[i]);
It moves polygon vertex to the next physical pixel if it's position is actually between pixels.
This technique seems like eliminating visual artifacts with U++ rendering of adjacent polygons.

[Updated on: Sat, 12 March 2011 22:58]

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
Previous Topic: How does CtrlCore Image::Data::PaintImp work?
Next Topic: Loading 16 bits per channel Tiff files
Goto Forum:
  


Current Time: Tue May 21 20:15:36 CEST 2024

Total time taken to generate the page: 0.01764 seconds