From 2a6044643c8966737c3d0712c32411644f732544 Mon Sep 17 00:00:00 2001 From: Elias Batek Date: Sun, 26 May 2024 18:40:15 +0200 Subject: [PATCH] Add example to doc comment of Gamut integration --- pixmappaint.d | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pixmappaint.d b/pixmappaint.d index 99db70d..c2370ae 100644 --- a/pixmappaint.d +++ b/pixmappaint.d @@ -311,6 +311,16 @@ static if (hasGamutIntegration) { /++ Creates a Pixmap copying the pixel data from the provided [GamutImage]. + + --- + // Load image using Gamut + import gamut; + Image img; + img.loadFromFile("dunes.jpg"); + + // Convert to Pixmap + Pixmap pixmap = img.toPixmap(); + --- +/ bool toPixmap(ref GamutImage source, out Pixmap result) @trusted nothrow in (source.isValid) {