Calculate size of entities in pixels

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
levinsy
Newbie Member
Posts: 6
Joined: Wed Jun 12, 2019 4:38 pm

Calculate size of entities in pixels

Post by levinsy » Sun Jun 23, 2019 3:18 pm

Hi,

Is it possible to get the size in pixels of entities in a drawing as if they were projected on a screen when using the js api?
More precisely what I'm trying to achieve is to zoom an RBox on the entire view port and then calculate its pixel size and the pixel size of all of the entities contained inside that RBox.


Thanks,
Yair

User avatar
andrew
Site Admin
Posts: 9061
Joined: Fri Mar 30, 2007 6:07 am

Re: Calculate size of entities in pixels

Post by andrew » Tue Jun 25, 2019 10:38 am

You can convert between vector measurements and screen measurements (pixels) using the map functions in RGraphicsView (mapToView, mapDistanceToView, mapFromView, mapDistanceFromView).

levinsy
Newbie Member
Posts: 6
Joined: Wed Jun 12, 2019 4:38 pm

Re: Calculate size of entities in pixels

Post by levinsy » Tue Jun 25, 2019 6:43 pm

Thanks.

Post Reply

Return to “QCAD 'How Do I' Questions”