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

Check if kPlacedArt is mirrored

Explorer ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

Hi,

 

I'm struggling with the following issue.

 

Suppose, a user want to do the following:

  1. Placing an Image on a Document
  2. Mirror that image (horizontal or vertical)

 

So my question now is:

Is it possible to find out if that image is mirrored or not? As far as I found out, this image is handled as a "kPlacedArt" by Illustrator, and I was not able to find any function which gives me the mirror-information.

 

Thanks!

TOPICS
SDK

Views

246

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

Explorer , Nov 17, 2020 Nov 17, 2020

You might want to look into AIPlacedSuite and the function GetPlacedMatrix.

I am not sure since I cannot test right now, but the matrix should contain the scaling which would be negative if it is mirrored.

Votes

Translate

Translate
Adobe
Explorer ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

You might want to look into AIPlacedSuite and the function GetPlacedMatrix.

I am not sure since I cannot test right now, but the matrix should contain the scaling which would be negative if it is mirrored.

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
Explorer ,
Jan 05, 2021 Jan 05, 2021

Copy link to clipboard

Copied

LATEST

Solved it now like in the following codesnipet (just wanted to check if it is mirrored or not, no distinguishon between horizontal and vertical or both):

sAIPlaced->GetPlacedMatrix(art, &mat);
sAIRealMath->AIRealMatrixGetRotate(&mat, &angleRad1);

if (mat.a > 0 && mat.d < 0) {
    return false;
}
else if (mat.a > 0 && mat.d > 0) {
    return true;
}
else if (mat.a < 0 && mat.d < 0) {
    return true;
}
else if (mat.a < 0 && mat.d > 0) {
    return false;
}

 

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