Copy link to clipboard
Copied
Hi all,
I want to retrieve the stroke align type values which is applied for the different path.
sAIArt->SetArtUserAttr(art, kArtSelected, kArtSelected);
the above code i used to select the each path
ai::uint32 strokeAlignType;
strokeAlignType = sAIPaintStyle->GetStrokeAlignmentFromSelection();
cout << "strokeAlignType = "<<strokeAlignType <<endl;
the above code i used to retrieve the stroke align type for the selected path.
but while retriving the property im getting same stroke align type value, which is applied for the first path.
can anyone help me to solve this solution.
Thanks
Copy link to clipboard
Copied
To get stroke-specific information and support multi-stroke/fill you'll need to parse the style -- that means AIStyleParser.h. All art has a style, even if you haven't applied a Graphics Style to it -- Graphic Styles are just named styles. When you apply colour or stroke properties to an art object, you are modifying it's anonymous style. So get the AIArtStyleHaadle for the AIArtHandle in question, create a style parser & parse the AIArtStyleHaadle. You can then iterate each stroke and/or fill. For some, you can get easy-to-access properties, but for others you'll need to get the dictionary that contains their stroke or fill parameters. You can use the AIBeauthifulStrokes.h functions to help.
You can find an example of iterating stroke & fill in InspectFillStrokeAndBlend() in the sample code samplecode/CodeSnippets/SnpGraphicStyle.cpp
Copy link to clipboard
Copied
hi
i tried the solution which you have menstioned , there i can get the basic stroke properties like cap, join, miter and width.
but didn't sloution to retrieve stroke align properties which is applied for the art object..
can i get example code to retrieve stroke align property which is applied for the art object...
Thanks