Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

store image in database

32 views
Skip to first unread message

michelangelo giacomelli

unread,
Mar 13, 2009, 10:54:07 AM3/13/09
to
Hi, how i can store an image into a database?
i think should take content of picture box encode in base 64 e store in
db as text?

thx

Christian Schmitz

unread,
Mar 13, 2009, 2:40:18 PM3/13/09
to
michelangelo giacomelli <michel...@blu.it> wrote:

You can. You have to think about how you want to compress the image.
JPEG, PNG, TIFF?

Something like this:

// get the picture
dim pic as Picture = LogoMBS(100)

// compress with PNG
dim data as string = PictureToPNGStringMBS(pic,0)

// make text using Base64 encoding
dim text as string = EncodeBase64(data)

// display
MsgBox text

Greetings
Christian

--
Over 1100 classes with 22000 functions in one REALbasic plug-in.
The Monkeybread Software Realbasic Plugin v9.0.

<http://www.monkeybreadsoftware.de/realbasic/plugins.shtml>

michelangelo giacomelli

unread,
Mar 16, 2009, 5:06:46 AM3/16/09
to
Christian Schmitz ha scritto:

> michelangelo giacomelli <michel...@blu.it> wrote:
>
>> Hi, how i can store an image into a database?
>> i think should take content of picture box encode in base 64 e store in
>> db as text?
>
> You can. You have to think about how you want to compress the image.
> JPEG, PNG, TIFF?
>
> Something like this:
>
> // get the picture
> dim pic as Picture = LogoMBS(100)
>
> // compress with PNG
> dim data as string = PictureToPNGStringMBS(pic,0)
>
> // make text using Base64 encoding
> dim text as string = EncodeBase64(data)
>
> // display
> MsgBox text
>
> Greetings
> Christian
>
There is possible without mbs plugin? (or at least with a free plugin)
now with my budget can't buy any commercial plugin...

Christian Schmitz

unread,
Mar 16, 2009, 5:08:57 AM3/16/09
to
michelangelo giacomelli <michel...@blu.it> wrote:

> There is possible without mbs plugin? (or at least with a free plugin)
> now with my budget can't buy any commercial plugin...

You can write to a file and read that file with a binarystream.

PS: The PNG plugin is just 20 Euro.

Greetings
Christian

--
Over 1500 classes with 29000 functions in one REALbasic plug-in.
The Monkeybread Software Realbasic Plugin v9.2.

<http://www.monkeybreadsoftware.de/realbasic/plugins.shtml>

michelangelo giacomelli

unread,
Mar 16, 2009, 7:35:07 AM3/16/09
to
michelangelo giacomelli ha scritto:
i have find a more simply way of storing image into db:
http://forums.realsoftware.com/viewtopic.php?f=3&t=4342

thx to all

0 new messages