• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Cannot get DrawArtSuite;;DrawArt to work

Contributor ,
Mar 06, 2023 Mar 06, 2023

Copy link to clipboard

Copied

HI, I am trying to use DrawArt to generate thumbnails for display in CEP panels

This relevant part of my code:

int dimen = 48;
AIDrawArtAGMPort port;
if(error = sAIDrawArt->CreateImagePort(dimen, dimen, &port.port))
	return error;
AIRealRect bounds;
if(error = sAIArt->GetArtBounds(art, &bounds))
	return error;
AIDrawArtData artData;
artData.version = kAIDrawArtSuiteVersion;
artData.output.port = port;
artData.origin.v = bounds.top;
artData.origin.h = bounds.left;
artData.destClipRect.left = artData.destClipRect.top = 0;
artData.destClipRect.right = dimen;
artData.destClipRect.bottom = -dimen;	// tried + and -
artData.eraseDestClipRect = 1;
artData.matrix.Init();
artData.matrix.a = artData.matrix.d = dimen / max(bounds.right-bounds.left, bounds.top-bounds.bottom);
artData.flags = kAIDrawArtPreviewBit;
artData.type = kAIDrawArtAGMPortOutput;
artData.doSrcClip = 0;
artData.art = art;
const AIColorConvertOptions options;
if(error = sAIDrawArt->BeginDrawArt(&artData, options, artData.flags))
	return error;
if(error = sAIDrawArt->DrawArt(&artData, options))
	return error;
if(error = sAIDrawArt->EndDrawArt(&artData, options))
	return error;
const ai::uint8* pixelData = NULL;
if(error = sAIDrawArt->GetImagePixelData(port.port, &pixelData, &length, NULL, NULL))
	return error;

. When this finishes, I get data all zeroes

 

TOPICS
SDK

Views

269

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Mar 08, 2023 Mar 08, 2023

My understanding is that the AIDrawArt suite is not really meant for public consumption. It has one or two methods in it that are useful (DrawHilite for example). I'm not saying it can't work, but I was sort of warned away from it years ago.


If you need a thumbnail of some art there are other ways to do it. You can use the AIRasterizeSuite to render any artwork on the artboard and get the pixel data that way. If you don't want to do it for art that exists on the artboard, there are a few tricks f

...

Votes

Translate

Translate
Adobe
Guide ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

LATEST

My understanding is that the AIDrawArt suite is not really meant for public consumption. It has one or two methods in it that are useful (DrawHilite for example). I'm not saying it can't work, but I was sort of warned away from it years ago.


If you need a thumbnail of some art there are other ways to do it. You can use the AIRasterizeSuite to render any artwork on the artboard and get the pixel data that way. If you don't want to do it for art that exists on the artboard, there are a few tricks for rendering it off screen that involve dictionaries but it's doable.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines