J'ai une fonction draw (SkCanvas * canvas).Skia SkCanvas ne peut pas être construit avec SkBitmap
En main() je vous écris:
SkBitmap myBitmap;
myBitmap.allocN32Pixels(640, 480);
SkCanvas *myCanvas(&myBitmap);
draw(myCanvas);
Mais Visual Studio génère cette erreur:
"a value of type "SkBitmap *" cannot be used to initialize an entity of type "SkCanvas*"
Qu'est-ce que je fais mal?
Ma fonction draw() encombre le message et est complètement inutile pour cette question sinon je l'ai posté.
Ceci est la construction de SkCanvas.
/** Construct a canvas with the specified bitmap to draw into.
@param bitmap Specifies a bitmap for the canvas to draw into. Its
structure are copied to the canvas.
*/
explicit SkCanvas(const SkBitmap& bitmap);
Il a seulement résolu la moitié de mon problème. L'erreur "Le constructeur ne correspond pas" persiste toujours. – Aurlito
@aurk vous avez également mal lu le constructeur de bitmap de toile. Fixé. – Yakk
Cela a fonctionné. Merci. Besoin de vraiment lire les docs. – Aurlito