| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
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
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.