Bitmap/Read a PPM file: Difference between revisions
Content added Content deleted
(Added Kotlin) |
No edit summary |
||
Line 1,975: | Line 1,975: | ||
SetVid(3); \restore normal text display |
SetVid(3); \restore normal text display |
||
]</lang> |
]</lang> |
||
=={{header|Yabasic}}== |
|||
<lang Yabasic>sub readPPM(f$) |
|||
local ff, x, y, t$, dcol$, wid, hei |
|||
if f$ = "" print "No PPM file name indicate." : return false |
|||
ff = open (f$, "rb") |
|||
if not ff print "File ", f$, " not found." : return false |
|||
input #ff t$, wid, hei, dcol$ |
|||
if t$ = "P6" then |
|||
open window wid, hei |
|||
for x = 0 to hei - 1 |
|||
for y = 0 to wid - 1 |
|||
color peek(#ff), peek(#ff), peek(#ff) |
|||
dot y, x |
|||
next y |
|||
next x |
|||
close #ff |
|||
else |
|||
print "File is NOT PPM P6 type." : return false |
|||
end if |
|||
return true |
|||
end sub</lang> |
|||
=={{header|zkl}}== |
=={{header|zkl}}== |