summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2023-01-05 20:22:55 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2023-01-05 20:22:55 +0100
commit659b8f28e591006b6d0669c05d809d6ccf60cec0 (patch)
tree287a360fe83cfb90ccf7507c46022771fc11da4e /metapost
parent705b807c950a697d3c8be592c452a6fb3e561c7e (diff)
downloadcontext-659b8f28e591006b6d0669c05d809d6ccf60cec0.tar.gz
2023-01-05 17:46:00
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mpxl/mp-mlib.mpxl26
1 files changed, 19 insertions, 7 deletions
diff --git a/metapost/context/base/mpxl/mp-mlib.mpxl b/metapost/context/base/mpxl/mp-mlib.mpxl
index 411095e5d..26aacb35d 100644
--- a/metapost/context/base/mpxl/mp-mlib.mpxl
+++ b/metapost/context/base/mpxl/mp-mlib.mpxl
@@ -1371,13 +1371,25 @@ permanent verbatim ;
% New
-def bitmapimage(expr xresolution, yresolution, data) =
- image (
- addto currentpicture doublepath unitsquare
- withprescript "bm_xresolution=" & decimal xresolution
- withprescript "bm_yresolution=" & decimal yresolution
- withpostscript data ;
- )
+% def bitmapimage(expr xresolution, yresolution, data) =
+% image (
+% addto currentpicture doublepath unitsquare
+% withprescript "bm_xresolution=" & decimal xresolution
+% withprescript "bm_yresolution=" & decimal yresolution
+% withpostscript data ;
+% )
+% enddef ;
+
+vardef bitmapimage(expr xresolution, yresolution, data) =
+ save p ; picture p ; p := nullpicture ;
+ addto p doublepath unitsquare
+% xscaled xresolution
+% yscaled yresolution
+ withprescript "bm_xresolution=" & decimal xresolution
+ withprescript "bm_yresolution=" & decimal yresolution
+ withpostscript data
+ ;
+ p
enddef ;
permanent bitmapimage ;