Less spaces in command history.
smaller save file size.
This commit is contained in:
parent
c302cb6139
commit
4bae8cde8f
2 changed files with 40 additions and 36 deletions
|
|
@ -20,7 +20,7 @@ Sub SaveBinaryPPM (imageHandle As Long, fileName As String)
|
|||
length = inPosition + w * h * 4
|
||||
head = "P6" + Chr$(10)
|
||||
head = head + "# Created with QB64" + Chr$(10)
|
||||
head = head + LTrim$(Str$(w) + Str$(h)) + Chr$(10)
|
||||
head = head + LTrim$(str$(w) + tst(h)) + Chr$(10)
|
||||
head = head + "255" + Chr$(10)
|
||||
filebuffer = _MemNew(w * h * 3)
|
||||
outPosition = filebuffer.OFFSET
|
||||
|
|
@ -56,7 +56,7 @@ Sub save24bitBmp (imageHandle As Long, fileName As String)
|
|||
_Source imageHandle
|
||||
|
||||
header = "BM" + MKL$(_Width * _Height * 3 + 54) +_
|
||||
String$(4, 0) + MKL$(54) + MKL$(40) +_
|
||||
String$(4, 0) + MKL$(54) + MKL$(40) +_
|
||||
MKL$(_Width) + MKL$(_Height) +_
|
||||
MKI$(1) + MKI$(24) + MKL$(0) + MKL$(0) +_
|
||||
MKL$(11811) + MKL$(11811) + MKL$(0) + MKL$(0)
|
||||
|
|
@ -95,7 +95,7 @@ Sub save8bitPNG (imagehandle As Long, filename As String)
|
|||
IHDR = "IHDR" + MKL$(FlipBytes(_Width(imagehandle))) + MKL$(FlipBytes(_Height(imagehandle))) + Chr$(8) + Chr$(3) + String$(3, 0)
|
||||
IHDR = MKL$(FlipBytes(&H0D)) + IHDR + MKL$(FlipBytes(crc32(IHDR)))
|
||||
IEND = MKL$(0) + "IEND" + MKL$(FlipBytes(&HAE426082))
|
||||
PLTE = "PLTE"
|
||||
PLTE = "PLTE"
|
||||
for c = 0 to 255
|
||||
PLTE = PLTE + chr$(_Red32(_PaletteColor(c)))
|
||||
PLTE = PLTE + chr$(_Green32(_PaletteColor(c)))
|
||||
|
|
@ -200,4 +200,4 @@ Function crc32~& (IN$)
|
|||
Next J
|
||||
Next I
|
||||
crc32~& = Not CRC
|
||||
End Function
|
||||
End Function
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue