Developing with Graphics/ja

From Lazarus wiki
Revision as of 01:52, 20 March 2006 by Saeka-jp (talk | contribs)
Jump to navigationJump to search

このページは、どのようにビットマップや、その他のグラフィックスを扱うかのチュートリアルの最初のページになるでしょう。 私はグラフィクスに携わっていないので、専門的な経験を披露してくれる皆さんを招待します。 次の項目にリンクやページを追加して、Wikiを製作してください。

このページで、一般的なお知らせをすることがあります。

(訳注:すみません、Wikiでうまく「日本語」ページとしてリンクが出来ていません。どうすればいいのでしょうか。)


(英文による 原文) This page will be the start of tutorials with regard to manipulating Bitmaps and other graphics. As I am not a graphics programmer, I invite all who are to share their expertise! Just add a link to the next section, add a page and create your own WiKi article.

On this page some general information will be given.


ビットマップ上の作業 (訳注:本来は別セクションとして記述) Working with TBitmap


最初に思い出してほしいのは、Lazarusはプラットホームに対して独立しているということです。 ですから、WindowsAPIの機能を使うメソッドは言うまでもありません。 Scanlineを使うメソッドは、Lazarusではサポートしません。 なぜなら、ScanlineはDevice Independant Bitmap(DIB)を扱い、GDI32.dllを使うことになるからです。

もし、あなたがTBitmapにwidth,heightを特定しないなら、デフォルトはかなり小さいものになっているので、気をつけてください。

フェーディングの例: フェーディングするピクチャを作りたい場合、Delphiでは、このように書けます。


(英文による 原文) The first thing to remember is that Lazarus is meant to be platform independent, so any methods using Windows API functionality are out of the question. So a method like ScanLine is not supported by Lazarus because it is intended for Device Independant Bitmap and uses functions from the GDI32.dll.

Be careful that if you do not specify the width and height of your TBitmap it will have the standard one, which is quite small.

[edit]A fading example Say you want to make a Fading picture. In Delphi you could do something like:

<< コード例


上の関数は、Lazarusでは、このように実装します。

(英文による 原文) This function in Lazarus could be implemented like:

(英文による 原文)

Notice the memory operations performed with the TMemoryStream. They are necessary to ensure the correct loading of the image.


<< コード例