Bitmap/Histogram: Difference between revisions

m
→‎{{header|Wren}}: ImageData.loadFromFile now deprecated, changed to ImageData.load
m (Automated syntax highlighting fixup (second round - minor fixes))
m (→‎{{header|Wren}}: ImageData.loadFromFile now deprecated, changed to ImageData.load)
 
(3 intermediate revisions by 2 users not shown)
Line 515:
dup bdim * over bdata + swap bdata
do 1 over i c@ cells + +! loop drop ;</syntaxhighlight>
\ will not work as far as bdim bdata are not ans forth words
\ do not forget to assign them yourself in your code
 
=={{header|GnuForth 0.7}}==
<syntaxhighlight lang="forth">
: bar ( v y x -- )
2dup at-xy .\" [" 100 spaces .\" ]" swap 1 + swap at-xy 0
DO .\" #"
LOOP
cr ;
: demo \ just demo to show it working in percentage 1% to 4%
5 1
DO i 10 i bar
LOOP
cr ;
\ will display :
[# ]
[## ]
[### ]
[#### ]
</syntaxhighlight>
Call it from an array
0 toto swap cells + @ 10 5 bar \ draws bar from first item of toto array
 
=={{header|Fortran}}==
{{works with|Fortran|90 and later}}
Line 1,716 ⟶ 1,740:
=={{header|Wren}}==
{{libheader|DOME}}
<syntaxhighlight lang="ecmascriptwren">import "dome" for Window
import "graphics" for Canvas, Color, ImageData
 
class ImageHistogram {
construct new(filename, filename2) {
_image = ImageData.loadFromFileload(filename)
Window.resize(_image.width, _image.height)
Canvas.resize(_image.width, _image.height)
Line 1,801 ⟶ 1,825:
 
var Game = ImageHistogram.new("Lenna100.jpg", "Lenna100_B&W.png")</syntaxhighlight>
 
=={{header|zkl}}==
{{trans|C}}
9,476

edits