Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all, i've taken a screenshot of my project and paste that in MS Paint.now i want to get the correct width and height of controls in that screenshot, thereby i can place more controls in my dialog with same width and height.how can i move with this?please help me,plase..
Posted
Comments
Resmi Anna 3-Jun-11 0:28am    
You need to get it Programmatically from bmp or jpeg file??
Jijesh Balakrishnan 3-Jun-11 0:37am    
jpeg
Resmi Anna 3-Jun-11 0:50am    
Your requirment is still not clear.
You just need to know the wdt/ht of controls to create the same kind of controls in the same dialog. why do u want to get it from jpeg file. In VS itself you have the option to create it in same size rt?
Jijesh Balakrishnan 3-Jun-11 0:57am    
because the screenshot that i've taken is not my code and i'm not able to get the code.i just got the screenshot and i should insert controls of same type and size.that is the reason
Resmi Anna 3-Jun-11 1:05am    
In mspaint itself you can do this.
Zoom the image to larger size from mspaint
Insert Grid by pressing Ctrl+G
at the bottom left corner you can see the coordinate of each mouse point.

Use Adobe Photoshop, there you have ruler and scale to measure pixels. There are various other complex image editors which you can take in handy.
 
Share this answer
 
v2
Actually I am not sure that you want your control width and height using program or with the help of mspaint.

1) If using mspaint than you can first select "magnifier" from the tool and select its range to 8x and than press "Ctrl + g" and than check the width and height of the control.

2)Use GetRect() to get the size of control and with the help of the rectangle you get you can find the width and height of control.
 
Share this answer
 
Comments
Jijesh Balakrishnan 3-Jun-11 1:09am    
thank You..
ShilpiP 3-Jun-11 1:13am    
Most welcome....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900