when a image is loaded,like that:
image = new RImageEntity(doc, RImageData(strImageFile, RVector(0,0),RVector(1,0), RVector(0,1), 50, 50, 0));
image->setInsertionPoint(drawSect->ptDemInsert);
double pWid = image->getPixelWidth() * xRes;
double pHei = image->getPixelHeight() * xRes;
image->setWidth(pWid);
image->setHeight(pHei);
image->setAngle(0);
when a mouse position is got, how can i get postion in the image?
xRes,yRes are pixel resolution
how can i get mouse position in a image
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
-
- Active Member
- Posts: 33
- Joined: Thu Jan 14, 2016 4:17 am
Re: how can i get mouse position in a image
You'd have to calculate it using the image position, angle and width / height. There is no function to translate coordinates to image coordinates and vice versa.