On 17-Mar-07, at 2:25 PM, Alexander Cohen wrote:
> Does anyone have any sample code on how to convert a REALpicture to a
> CGImageRef?
This should probably be easy in Cocoa targets but for now I'm pretty
sure you have to jump through some hoops:
1). Grab a REALpictureDescription with REALLockPictureDescription
asking for a pictureMacintoshGWorld
2). Use QDBegin/EndCGContext on REALpictureDescription.pictureData to
get a CGContextRef
3). Use CGBitmapContextCreateImage (or some other mechanism) to get a
CGImageRef from the CGContextRef
This should be pretty straightforward but there's code up to step #2
in the PNG Utilities plugin if you want an example (hit the link in
my sig). Unfortunately CGBitmapContextCreateImage requires Mac OS X
10.4, and supporting lesser systems may require copying the data out
of the CGContextRef and creating the CGImageRef manually (PNG
Utilities copies the data, but for different reasons).
Frank.
<http://developer.chaoticbox.com/>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
From Thu 22 Mar 2007 16:46:34 +0100
Return-Path: <realbasic-plugins-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
id 62F461C994F9; Thu, 22 Mar 2007 08:46:45 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
www.realsoftware.com
X-Spam-Level:
X-Spam-Status: No, score=-2.5 required=4.5 tests=AWL,BAYES_00 autolearn=ham
version=3.1.1
Received: from lists.realsoftware.com (m.realsoftware.com [66.116.103.65])
by xmail.realsoftware.com (Postfix) with ESMTP id 0A6291C994EF;
Thu, 22 Mar 2007 08:46:44 -0700 (PDT)
Received: from real-software-mini.local (localhost [127.0.0.1])
by lists.realsoftware.com (Postfix) with ESMTP id 5AED5173CDF;
Thu, 22 Mar 2007 10:46:41 -0500 (CDT)
X-Original-To: realbasic-plugins at lists dot realsoftware dot com
Delivered-To: realbasic-plugins at lists dot realsoftware dot com
Received: from smtprelay06.ispgateway.de (smtprelay06.ispgateway.de
[80.67.18.44])
by lists.realsoftware.com (Postfix) with ESMTP id 1E43F173CD2
for <realbasic-plugins at lists dot realsoftware dot com>;
Thu, 22 Mar 2007 10:46:36 -0500 (CDT)
Received: (qmail 9209 invoked from network); 22 Mar 2007 15:46:35 -0000
Received: from unknown (HELO [192.168.1.80]) (363246 at [84 dot 175 dot 105 dot
199])
(envelope-sender <support at monkeybreadsoftware dot de>)
by smtprelay06.ispgateway.de (qmail-ldap-1.03) with SMTP
for <realbasic-plugins at lists dot realsoftware dot com>;
22 Mar 2007 15:46:35 -0000
To: realbasic-plugins at lists dot realsoftware dot com
Subject: REALBuildPictureFromBuffer?
From: support at monkeybreadsoftware dot de (Christian Schmitz)
Date: Thu, 22 Mar 2007 16:46:34 +0100
Message-ID: <1hvdykp dot ywugi9sv0o4yM%support at monkeybreadsoftware dot de>
MIME-Version: 1.0
Organization: Monkeybread Software Germany
X-Face: nrf3>{WQ6c&r+7 at e)"]0G60`-6ND^)I2mI%>)QGYa=9"=7jhd-g2|b3!>Al0+
Ccb%xGQshhi|g at QU2$
User-Agent: MacSOUP/D-2.8 (Mac OS X version 10.4.9 (PPC))
X-BeenThere: realbasic-plugins at lists dot realsoftware dot com
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot
com>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: realbasic-plugins-bounces at lists dot realsoftware dot com
Errors-To: realbasic-plugins-bounces at lists dot realsoftware dot com
Hi,
just to confirm.
For Linux the kRBPixelRGB24 mode is the fastest for
REALBuildPictureFromBuffer. Correct?
Before I used kRBPixelBGRX32.
Gru=DF
Christian
-- =
Around twelve thousand functions in one REALbasic plug-in. =
The Monkeybread Software Realbasic Plugin v7.0. Now universal!
<http://www.monkeybreadsoftware.de/realbasic/plugins.shtml>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|