Click here to Skip to main content
15,849,829 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Dear All,

I need to create bit maps dynamically, always the bit map size is constant say 150,70. i need to create some lines on the bit map, the line points are getting from the application but the points are greater than the total bitmap area. how to scale down the points and fit it in to the bitmap exartly?

Thanks in advance.

Regards,
Anil
Posted
Comments
Fredrik Bornander 10-Dec-10 4:02am    
It depends, is there a fixed size for the area that the points can occupy in the other application, or is it the case that the left most point should always appear at X=0 in the bitmap?

1 solution

you have to calculate the points by code ...

First, you need to know the maximum values you can get from the application.

for example: max value from the application is 2000, 500, and you get the point 1000,100 you need to calculate:

(1000/2000)*150
and
(100/500)*70

and you have your exact points within the bitmap.
 
Share this answer
 

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