Skip to main content
Inspiring
Feb 10, 2025 6:19 AM UTC
Answered

Can someone explain the usage of the setgradient function in the IGraphicsPort interface?

In the IGraphicsPort interface, there is a virtual function:

 

virtual void setgradient(AGMGradient *agmGrad, const PMMatrix& grMatrix,
                         const PMReal &xOrig, const PMReal &yOrig,
                         const PMReal &len, const PMReal &ang,
                         const PMReal &hiliteLen, const PMReal &hiliteAng) = 0;

 

I couldn't find a precise definition of the first parameter, AGMGradient *agmGrad. I assume that this requires a pointer to some other object, but how should this object be created? What exactly needs to be passed in?

Dirk BeckerCorrect answer
Legend
Feb 10, 2025 11:15 AM UTC

AGM is an old library exposed via wrappers ony, the actual AGM* structures remain opaque / forward declarations, similar to CT* structures. Related methods are in a private (no headers provided) gradient utils class.

 

Please file a feature request in developer prerelease to expose the header.

 

3 replies

Dirk BeckerCorrect answer
Legend
Feb 10, 2025 11:15 AM UTC

AGM is an old library exposed via wrappers ony, the actual AGM* structures remain opaque / forward declarations, similar to CT* structures. Related methods are in a private (no headers provided) gradient utils class.

 

Please file a feature request in developer prerelease to expose the header.

 

Translate
Legend
Feb 10, 2025 11:35 AM UTC

I should have checked the SDK first. Above was from 2018 when I last tried to examine such an object.

Gradients are a rendering object similar to color swatches, tint etc., applying such a rendering object should do.

I'd first try IGradientFillInstall though.

 

Translate
lyj2871Author
Inspiring
Feb 11, 2025 1:14 AM UTC

Could  you share some sample code? Thanks.

Translate