Writing bitmaps as their own file

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Writing bitmaps as their own file

glasspin
Reading through the documentation, it appears bitmaps can only be
written out into stream files (buffer.write). I'm writing a bitmap
editor and would like to save the images back out to the card. Would
this require something outside of Plua?

Reply | Threaded
Open this post in threaded view
|

Re: Writing bitmaps as their own file

Berkant Atay

--- glasspin <[hidden email]> wrote:

> Reading through the documentation, it appears
> bitmaps can only be
> written out into stream files (buffer.write). I'm
> writing a bitmap
> editor and would like to save the images back out to
> the card. Would
> this require something outside of Plua?
>
>

buffer.write(filename[,id]) command will write the
buffer identified by "id", in the file "filename".
Hope this helps.
Reply | Threaded
Open this post in threaded view
|

Re: Writing bitmaps as their own file

glasspin
--- In [hidden email], Berkant Atay <berkant_atay@...> wrote:

>
>
> --- glasspin <glasspin@...> wrote:
>
> > Reading through the documentation, it appears
> > bitmaps can only be
> > written out into stream files (buffer.write). I'm
> > writing a bitmap
> > editor and would like to save the images back out to
> > the card. Would
> > this require something outside of Plua?
> >
> >
>
> buffer.write(filename[,id]) command will write the
> buffer identified by "id", in the file "filename".
> Hope this helps.
>
Yes, that writes the buffer into an existing stream file. See section
4.2.1 in the plua doc.

Reply | Threaded
Open this post in threaded view
|

Re: Writing bitmaps as their own file

Berkant Atay
In reply to this post by Berkant Atay

--- Berkant Atay <[hidden email]> wrote:

>
> --- glasspin <[hidden email]> wrote:
>
> > Reading through the documentation, it appears
> > bitmaps can only be
> > written out into stream files (buffer.write). I'm
> > writing a bitmap
> > editor and would like to save the images back out
> to
> > the card. Would
> > this require something outside of Plua?
> >
> >
>
> buffer.write(filename[,id]) command will write the
> buffer identified by "id", in the file "filename".
> Hope this helps.
>

Hi again,

buffer.write can write onto the SD card as well as
internal memory. For example, last night I checked if
I can resize bitmaps in Plua. First reading my bike's
bitmap photograph from the card, and then creating a
new buffer with a smaller pic, and saving the
finalized .bmp file seems to be easy, but Plua is far
too slow.. The line:

write.buffer("vfs0:/PALM/PROGRAMS/Plua/SRC/SuzukiGSR600K7halfthesize.bmp",bufnew)

will create a bitmap file of my bike's pic, as a
bitmap file that can be read by all OS's..

Regards,

Berkant.
Reply | Threaded
Open this post in threaded view
|

Re: Writing bitmaps as their own file

glasspin
Confirmed. It works with a new buffer, so there must be something
wrong with the buffer I'm sending where the function returns nil.
Thanks for your help and pointing me in a the right direction!

--- In [hidden email], Berkant Atay <berkant_atay@...> wrote:

>
>
> --- Berkant Atay <berkant_atay@...> wrote:
>
> >
> > --- glasspin <glasspin@...> wrote:
> >
> > > Reading through the documentation, it appears
> > > bitmaps can only be
> > > written out into stream files (buffer.write). I'm
> > > writing a bitmap
> > > editor and would like to save the images back out
> > to
> > > the card. Would
> > > this require something outside of Plua?
> > >
> > >
> >
> > buffer.write(filename[,id]) command will write the
> > buffer identified by "id", in the file "filename".
> > Hope this helps.
> >
>
> Hi again,
>
> buffer.write can write onto the SD card as well as
> internal memory. For example, last night I checked if
> I can resize bitmaps in Plua. First reading my bike's
> bitmap photograph from the card, and then creating a
> new buffer with a smaller pic, and saving the
> finalized .bmp file seems to be easy, but Plua is far
> too slow.. The line:
>
>
write.buffer("vfs0:/PALM/PROGRAMS/Plua/SRC/SuzukiGSR600K7halfthesize.bmp",bufnew)
>
> will create a bitmap file of my bike's pic, as a
> bitmap file that can be read by all OS's..
>
> Regards,
>
> Berkant.
>