Check if kPlacedArt is mirrored

Explorer ,
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!

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.

TOPICS
SDK

Views

51

Likes

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

Check if kPlacedArt is mirrored

Explorer ,
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!

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.

TOPICS
SDK

Views

52

Likes

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
Nov 16, 2020 0
Explorer ,
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.

Likes

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
Reply
Loading...
Nov 17, 2020 0
Explorer ,
Jan 05, 2021

Copy link to clipboard

Copied

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;
}

 

Likes

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
Reply
Loading...
Jan 05, 2021 0
Resources