Making XAML Icons with MatrixTransform work |
Post Reply |
Author | |
DavidH
Groupie Joined: 24 March 2007 Status: Offline Points: 59 |
Post Options
Thanks(0)
Posted: 07 March 2023 at 8:44am |
As a reminder to myself, and hopefully helpful to others and the Codejock devs: To make MatrixTransform work as a RenderTransform in CJ 22.0.0, I had to make the following changes: - Source\Markup\XTPMarkupContext.cpp -> Add registrations to parser Add: #include "Markup/Transform/XTPMarkupMatrixTransform.h" #include "Markup/Transform/XTPMarkupGdiPlusMatrixTransform.h" in void CXTPMarkupContext::RegisterClasses(), add: CXTPMarkupGdiPlusMatrixTransform::RegisterType(); - Source\Markup\Transform\XTPMarkupGdiPlusMatrixTransform.cpp Simply use the transformation: BOOL CXTPMarkupGdiPlusMatrixTransform::TransformMatrix(const CXTPGdiPlus* pReserved,GpMatrix* pMatrix) { UNREFERENCED_PARAMETER(pReserved); ASSERT(NULL != pMatrix); const int matrixValues = 6; CXTPMarkupDoubleCollection* pValues = GetMatrix(); if (pValues->GetCount() < matrixValues || matrixValues > pValues->GetCount()) return FALSE; Matrix m((Gdiplus::REAL)pValues->GetAt(0), (Gdiplus::REAL)pValues->GetAt(1), (Gdiplus::REAL)pValues->GetAt(2), (Gdiplus::REAL)pValues->GetAt(3), (Gdiplus::REAL)pValues->GetAt(4), (Gdiplus::REAL)pValues->GetAt(5)); if (Gdiplus::Ok != GdipMultiplyMatrix(pMatrix, &m, Gdiplus::MatrixOrderPrepend)) return FALSE; return TRUE; } - Source\Markup\XTPMarkupObject.cpp Support floats with powers (e/E): BOOL CXTPMarkupDoubleCollection::GetNextValue(LPCWSTR& lpszValue, float& fValue) { while (*lpszValue != '\0' && isspace(*lpszValue)) lpszValue++; if (*lpszValue == '\0') { return FALSE; } WCHAR* lpszEnd; fValue = wcstof(lpszValue, &lpszEnd); auto result = lpszValue != lpszEnd; lpszValue = lpszEnd; return result; } |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |