A Bitmap Resize Algorithm

製品と環境

このセクションは、サンプルの作成に使用された製品およびOSを反映します。

以下に示された製品を含め、NIのソフトウェアをダウンロードするには、ni.com/downloadsをご覧ください。

    ソフトウェア

  • LabVIEW

    オペレーティングシステム

  • Windows

    プログラミング言語

  • LabVIEW G

コードとドキュメント

添付

Description

A Bitmap Resize Algorithm

 

This article handles a simple algorithm to resize (enlarge or reduce) computer pictures.

http://www.davdata.nl/math/bmresize-old.html

How to Use

We regard the bitmaps as pieces of paper.
A pixel is given the dimension 1 * 1.
The destination bitmap dimensions are the dimensions of the source bitmap
divided by a factor f.
So, for each destination pixel, a corresponding area (f*f) on the source map may be drawn.
In most cases, this area will partially overlap the pixels in the source.

The color of a destination pixel is the (weighted) addition of the colors of
the pixels covered on the source map.
In the picture above, 4 pixels in the source contribute to the (marked) pixel
in the destination.
This contribution is proportional to the area covered.

NIコミュニティのサンプルコード交換のサンプルコードは、MIT Licenseによりライセンス供与されています。