如何缩小BMP [英] How to scale down the bmp

查看:120
本文介绍了如何缩小BMP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我需要动态创建位图,始终将位图的大小保持不变,例如150,70.我需要在位图上创建一些线,线点是从应用程序中获取的,但是这些点大于总位图区域.如何缩小点并将其适当地适合位图?

提前谢谢.

问候,
Anil

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

推荐答案

您必须通过代码来计算点数...

首先,您需要知道可以从应用程序中获得的最大值.

例如:应用程序的最大值是2000、500,得到的点是1000,100,您需要计算:

(1000/2000)* 150

(100/500)* 70

并且您在位图中有确切的点.
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.


这篇关于如何缩小BMP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆