summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
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 ;