diff -Nru orig/tkrplot/src/tcltkimg.c patched/tkrplot/src/tcltkimg.c
--- orig/tkrplot/src/tcltkimg.c	2022-10-18 21:25:20.000000000 +0200
+++ patched/tkrplot/src/tcltkimg.c	2025-03-03 18:47:21.353375500 +0100
@@ -87,11 +87,12 @@
    TkWinGetDrawableDC and TkWinReleaseDrawableDC. */
 typedef struct TkWinDCState {
     HPALETTE palette;
+    int bkmode;
 } TkWinDCState;
 
 /* These declarations don't even appear in the Tk source heaters */
-HDC TkWinGetDrawableDC();
-void TkWinReleaseDrawableDC();
+HDC TkWinGetDrawableDC(Display*, Drawable, TkWinDCState*);
+void TkWinReleaseDrawableDC(Drawable, HDC, TkWinDCState*);
 
 typedef HENHMETAFILE RplotImage;
 #else
@@ -314,7 +315,8 @@
 
     SetRect(&rect, 0, 0, prpm->width, prpm->height);
     if (! PlayEnhMetaFile(hdc, prpm->image, &rect))
-      REprintf("error code %d playing mefafile\n", GetLastError());
+      REprintf("error code %lu playing mefafile\n",
+               (unsigned long)GetLastError());
     TkWinReleaseDrawableDC(drawable, hdc, &dcState);
 #else
     int depth = Tk_Depth(inst->tkwin);
