Pregunta

I want to use NSBitmapImageRep to construct a 64x64 pixel sprite in code, and then draw it to the screen, blown up very large. The result would be very large "pixels" on the screen. Think old school Mario Bros. or Minecraft. How can I do this?

Edit I want to draw to this off-screen bitmap and then render it later on a CALayer

¿Fue útil?

Solución

Open an new image context with CGBitmapContextCreate and use

void CGContextSetInterpolationQuality (
   CGContextRef c,
   CGInterpolationQuality quality
);

to set the interpolation quality to kCGInterpolationNone.

Then draw the image into the context.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top