?
Solved

HOW MANY TWIPS PER PIXEL

Posted on 1999-11-03
6
Medium Priority
?
909 Views
Last Modified: 2012-06-27
I use an API GetWindowRect(HWND hwnd, RECT *rect).
I want to know in which units (pixel or twips) are rect->top, rect->left,
rect->bottom, rect->right when this API
is called and if there are in twips how can I do to convert this measure in pixels, I want to know if this API is the best to retrieve the dimensions of the bounding rectangle of the specified window and if not, which the best.
0
Comment
Question by:nadiamehrez
  • 3
  • 2
6 Comments
 
LVL 2

Accepted Solution

by:
PIG earned 200 total points
ID: 2181169
GetWindowRect return all in pixels
And if You want to use twips
1 twips = 1/1440 inch
Yuo must use GetDeviceCapabilities
and get howmany pixels have for inch
0
 

Author Comment

by:nadiamehrez
ID: 2181319
>>You must use GetDeviceCapabilities
what's GetDeviceCapabilities, I don't find it and WHY I MUST USE IT, CAN YOU EXPLAIN YOU ANSWER
0
 
LVL 22

Expert Comment

by:nietod
ID: 2181780
Not GetDeviceCapabilites().  Use GetDeviceCaps().  You can use

GetDeviceCaps(LOGPIXELSX);
GetDeviceCaps(LOGPIXELSY);

to get the number of pixels per inch.  Then divide 1440 by these values to get the number of twips per pixel
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 22

Expert Comment

by:nietod
ID: 2183168
Did you mean to accept pig's answer?
0
 

Author Comment

by:nadiamehrez
ID: 2186023
yes i accept
0
 
LVL 22

Expert Comment

by:nietod
ID: 2186048
Well, they are your points....but itit seemed like you weren't happy with it, (not surprisingly!) that is why I added information.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question