/** SK_ScalarDefaultDPI is 72 dots per inch. */ static constexpr SkScalar SK_ScalarDefaultRasterDPI = 72.0f;
/** * High-level API for creating a document-based canvas. To use.. * * 1. Create a document, specifying a stream to store the output. * 2. For each "page" of content: * a. canvas = doc->beginPage(...) * b. draw_my_content(canvas); * c. doc->endPage(); * 3. Close the document with doc->close().
*/ class SK_API SkDocument : public SkRefCnt { public:
/** * Begin a new page for the document, returning the canvas that will draw * into the page. The document owns this canvas, and it will go out of * scope when endPage() or close() is called, or the document is deleted. * This will call endPage() if there is a currently active page.
*/
SkCanvas* beginPage(SkScalar width, SkScalar height, const SkRect* content = nullptr);
/** * Call endPage() when the content for the current page has been drawn * (into the canvas returned by beginPage()). After this call the canvas * returned by beginPage() will be out-of-scope.
*/ void endPage();
/** * Call close() when all pages have been drawn. This will close the file * or stream holding the document's contents. After close() the document * can no longer add new pages. Deleting the document will automatically * call close() if need be.
*/ void close();
/** * Call abort() to stop producing the document immediately. * The stream output must be ignored, and should not be trusted.
*/ void abort();
protected:
SkDocument(SkWStream*);
// note: subclasses must call close() in their destructor, as the base class // cannot do this for them.
~SkDocument() override;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.