realbasic-nug
[Top] [All Lists]

Re: Convert a picture to a string

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Convert a picture to a string
From: Frank Condello <developer at chaoticbox dot com>
Date: Mon, 31 Mar 2008 23:46:04 -0400
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <EDD8D161-B10C-41CB-BF8C-976589102378 at panamind dot com> <579C8404-03DB-45E2-9526-85FDD933DD67 at great-white-software dot com> <07A1DC73-96A0-46FF-90CC-1222B8E5BCB0 at oofile dot com dot au> <10CF30F0-3EFF-4DB4-8036-B5E52EAE88F5 at great-white-software dot com>
On 31-Mar-08, at 10:19 PM, Norman Palardy wrote:
>
> On 31-Mar-08, at 12:48 AM, Andy Dent wrote:
>>
>> On 29/03/2008, at 10:32 AM, Norman Palardy wrote:
>>>     dbrec = new databaseRecord
>>>     dbrec.JPEGColumn("any") = p
>>>     return dbrec.StringValue("any")
>>
>> Just thought I'd remind people that this is using a lossy JPEG
>> conversion whereas the PNG plugin-based approaches are non-lossy.
>
> Interestingly enough this does not actually turn it into a JEPG :P
> It's just  a way to get at the byte that make up a picture.
> I've used this exact same code with GIF's, PNG's and BMP's etc

To be clear, the StringToPict trick works with formats other than  
JPEG, but the reverse PictToString conversion (quoted above) most  
certainly returns JPEG data - and rather heavily compressed JPEG data  
by the looks of it. Also keep in mind that alpha channels are  
discarded in both cases.

Frank.
<http://developer.chaoticbox.com/blog/>




_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>