Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GraphicsImport into k24RGB gWorld?



It seems like it should work. Are you getting any error? what exactly do you mean by "not possible to draw".
By the way, why not use QTNewGWorld()? There is no need to create a buffer specifically for a GWorld, unless this buffer exists and is filled with information before the GWorld exists.

Yaron

On Saturday, September 14, 2002, at 07:01 AM, quicktime-api-
email@hidden wrote:

Date: Fri, 13 Sep 2002 16:13:12 -0400
To: email@hidden
From: Robert Winchester <email@hidden>
Subject: GraphicsImport into k24RGB gWorld?

Help! I've been trying the following code to import an image into a
k24RGBPixelFormat gWorld with no success. Is it NOT possible to do a
GraphicsImportDraw into a gWorld that is NOT a traditional
(k32ARGBPixelFormat) world?

(A lot of obvious stuff deleted for brevity):

err = GetGraphicsImporterForFile(&fsSpec, &graphicsImporter);

UInt32 bufferSize = imageSize.width * imageSize.height * 3;
Ptr rgbBuffer = NewPtr(bufferSize);

// Create a gWorld from the RGB buffer Ptr.

OSType pixelFormat = k24RGBPixelFormat; // No alpha channel!
CTabHandle cTable = nil;
GDHandle aGDevice = nil;
GWorldFlags flags = nil;
long rowBytes = imageSize.width * 3;

err = QTNewGWorldFromPtr(&gWorld, pixelFormat, &imageRect, cTable,
aGDevice, flags, rgbBuffer, rowBytes);

err = GraphicsImportSetGWorld(graphicsImporter, gWorld, nil);

err = GraphicsImportDraw(graphicsImporter);

err = CloseComponent(graphicsImporter);


Thanks,
Rob
_______________________________________________
quicktime-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/quicktime-api
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.