Ich habe eine Zeichnungsfunktion (SkCanvas * Canvas).Skia SkCanvas kann nicht mit SkBitmap erstellt werden
In main() Ich schreibe:
SkBitmap myBitmap;
myBitmap.allocN32Pixels(640, 480);
SkCanvas *myCanvas(&myBitmap);
draw(myCanvas);
Aber Visual Studio erzeugt diesen Fehler:
"a value of type "SkBitmap *" cannot be used to initialize an entity of type "SkCanvas*"
Was mache ich falsch?
Meine draw() Funktion klemmt den Beitrag und ist völlig nutzlos für diese Frage, sonst habe ich es gepostet.
Dies ist die Konstruktion für 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);
Es löste nur die Hälfte meines Problems. Der Fehler "Konstruktor stimmt nicht überein" bleibt bestehen. – Aurlito
@aurk Sie lesen auch den Canvas-Bitmap-Konstruktor falsch. Fest. – Yakk
Es hat funktioniert. Vielen Dank. Müssen die Dokumente wirklich lesen. – Aurlito