I can't open the links - they say 403 forbidden. But your sample code uses premultiplied alpha incorrectly. If you want to draw with an opacity of 50%, then you need to set the color RGBA components to (0.5, 0.5, 0.5, 0.5) - because the RGB components need to be multiplied by the opacity when using premultiplied alpha. SetOpacity() only changes the alpha component, so will leave the RGB components of the current color unpremultiplied.