No, the X,Y coordinates computation is wrong, see the red dots on the attached screen shot
Here is the code i am using to compute the X,Y dot location based on your suggestion.
void CreatePointArray(IN long selected) { // 03-20-2019
MobjMesh* pMesh = >m_meshes[selected];
long* index = &gnm_indexBuffer[pMesh->startIndex];
long vertsTotal = pMesh->triangleCount * 3;
long x = 0, y = 0, w = 0, h = 0, nW = 0, nH = 0, newID = 0, nIDtoClone = 0, nSpriteCount = 0;
ZI_GetImageSizeFromControl(gT.hZoomCtrl, nW, nH);
WCHAR zMarker[MAX_PATH] = { 0 };
Path_Combine(zMarker, MarkerPath(), L"dot_8.png");
HBITMAP hBitmap = ZI_CreateBitmapFromFile(zMarker, w, h);
long nCount = w / h; if ((nCount * h) != w) { nCount = 1; } else { w = h; }
w /= 2;
h /= 2;
WCHAR zAf[64] = { 0 };
for (int j = 0; j < vertsTotal; j++, index++) {
MobjVertexT* vertex = >m_vertexBuffer[gnm_indexBuffer[*index]];
x = (long) (nW * fmod(vertex->texCoord[0], 1.0f)) - w; // OpenGL tex coords may be a multiple of 1.0f if GL_REPEATed
y = (long) (nH * (1.0f - fmod(vertex->texCoord[1], 1.0f))) - h; // ditto
StringCchPrintf(zAf, strSize(zAf), L"x = %2d, y = %2d", x, y);
zTrace(zAf);
newID = IncrID(); // Increment ID and ga_Sprite array
if (nIDtoClone) { // Clone the dot object (the same bitmap is used by all the hot spots)
CloneObject(newID, $NULL, x, y, nIDtoClone);
// Comme c'est un clone, il faut réinitialiser les propriétés de l'objet GDImage.
ZD_SetObjectRotation(newID, 0);
ZD_SetObjectFlipMode(newID, 0);
ZD_SetObjectAngle(newID, 0, 0);
ZD_SetObjectScale(newID, 0);
ZD_SetObjectAlpha(newID, 255, FALSE);
ZD_SetObjectFlipMode(newID, ZD_GetObjectFlipMode(newID));
ZD_SetObjectVisibility(newID, ZS_VISIBLE);
} else { // We must use this bitmap.
ZD_DrawBitmapToCtrl(gT.hZoomCtrl, x, y, hBitmap, ZD_ColorARGB(255, 0), newID, ZS_VISIBLE);
nIDtoClone = newID;
}
if (nCount > 1) {
ZD_SetObjectFrameCount(newID, (BYTE) nCount); // <---- Sprite multi-state.
ZD_SetObjectFrameToUse(newID, 1, FALSE);
}
ZD_SetObjectScroll(newID, TRUE);
ZD_SetObjectQuality(newID, gT.UseQuality, FALSE);
SpriteArrayInit(newID, zMarker); // Initialize the global Sprite array
}
ZI_UpdateWindow(gT.hZoomCtrl, FALSE);
}