Dienstag, 20. Mai 2008

Scaling ... finally :)

Scaling is a pretty painful capter, I misunderstood a lot and in my opinion XRender is quite weird:
- Transformation is set on the source Picture
- Transformation does not affect destination coordinates

I don't really know OpenGL and maybe its the same there, but it somehow confuses(d) me.
It also implies that I have to validate also the source-surface (at least some states which are important when used as source) before blending with reversed transformation.

Furthermore the following method took me some hours of manual transformation-matrix tweaking:
public static int XDoubleToFixed(double dbl) { return (int) dbl*65536; }
Well not that problematic if you know whats going wrong, but if you suspect tons of other things going wrong, it takes quite some time. After all, something like this should not have happend ;)

Finally, here's a translucent pixmap - one time scaled down to 50% and one time scaled up to 200%:

Keine Kommentare: