このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。

翻訳前ページへ


製図/抽選 lines HOME  →  Lazarus Tutorials TOC     Other 構成要素 for programmers

Graphics

Introduction to 製図/抽選 with Lazarus

とじ込み/提出する:lt1NGraphics.htm


This page has good (警察などへの)密告,告訴(状), and a search button at the 底(に届く) of the page
Please don't 解任する it because it isn't 十分な of graphics, scripts, cookies, etc!

This page is "browser friendly". Make your browser window as wide as you want it. The text will flow nicely for you. It is easier to read in a 狭くする window. With most browsers, 圧力(をかける)ing 加える, minus or 無 while the 支配(する)/統制する 重要な (ctrl) is held 負かす/撃墜する will change the texts size. (大きくする, 減ずる, 回復する to default, それぞれ.) (This is more fully explained, and there's another tip, at my 力/強力にする Browsing page.)




Introduction to Graphics- Lazarus 見解/翻訳/版

(With Delphi 同等(の) also shown)

製図/抽選 is 平易な in Lazarus (and Delphi)... once you have a surface to draw on. This tutorial will show you how to create that surface.

I'm going to start with stripped 負かす/撃墜する "do it" 指示/教授/教育s which will give you a 爆撃する, an app with a (nearly) blank page for doing graphics on.

その上の 負かす/撃墜する the page, I explain the basics of using graphics with Lazarus or Delphi.

Quick path to empty 爆撃する for graphics work...

Open a new 使用/適用, save it in the usual way.

If you are 自信のない about something in the guide, had a look at the 完全にする 名簿(に載せる)/表(にあげる)ing of the finished code which appears at the 底(に届く) of this webpage.

Put an "image" 支配(する)/統制する on the form. It's final position and size will be adjusted by code in the FormCreate handler, so don't be too fussy about where you place it.

Put the に引き続いて in the interface section just below the word "私的な"...

    Bitmap:TBitmap;
    iImageLeft, iImageTop, iImageWidth, iImageHeight:integer;

(You can't, 式のs, just copy the code 卸売.

Put the に引き続いて in the OnCreate event handler...

iImageLeft:=50;
iImageTop:=10;
iImageWidth:=200;
iImageHeight:=100;

Image1.left:=iImageLeft;
Image1.最高の,を越す:=iImageTop;
Image1.width:=iImageWidth;
Image1.高さ:=iImageHeight;

(*Next, 割り当てる bitmap to the image...
This had 利益s in Delphi... I think it
was to do with getting what you see on
the 審査する to 生き残る re-sizings, etc.

Some examples of Lazarus graphics on the web
take a different approach... they 簡単に put
a bitmap 直接/まっすぐに on the main form. They don't
bother with the image... but they also
over-ride the built in "Paint" handler to do
it. I 港/避難所't 設立する problems with my "simpler" approach, at least not under Delphi, and this
little Lazarus "デモ" program 作品.

For the に引き続いて to work, you'll need a 使用者
defined 反対する called "Bitmap", of type Bitmap
(See 十分な sourcecode, below) *)

Bitmap:=TBitmap.create;//Create a bitmap 反対する
Bitmap.width:=iImageWidth;//割り当てる dimensions
Bitmap.高さ:=iImageHeight;

//In Delphi, bitmap background is white to begin with. 黒人/ボイコット in Lazarus
Bitmap.canvas.pen.color:=clWhite;//1 of 2 lines not needed in Delphi...
Bitmap.canvas.Rectangle(0,0,iImageWidth,iImageHeight);//2 of 2 not needed, Delphi

Image1.Picture.Graphic:=Bitmap; //割り当てる the bitmap to the image 構成要素

That's the general 目的 爆撃する created.

The に引き続いて also go in the OnCreate event handler, just to demostrate a few Lazarus/ Delphi 製図/抽選 道具s. You don't, of course, need these lines in your program for the 製図/抽選 surface to be 現在の and 訂正する.

//That's our 製図/抽選 surface "用意が出来ている".
//Now do some "tricks" with what we have, and learn
//  where "the 辛勝する/優位s" of the drawable area are...

//From 最高の,を越す left, across 最高の,を越す
Image1.Picture.Bitmap.canvas.pen.color:=clGreen;
Image1.Picture.Bitmap.canvas.moveto(0,0);
Image1.Picture.Bitmap.canvas.lineto(150,0);

//From 最高の,を越す left, along left 辛勝する/優位
Image1.Picture.Bitmap.canvas.pen.color:=clRed;
Image1.Picture.Bitmap.canvas.moveto(0,0);
Image1.Picture.Bitmap.canvas.lineto(0,60);

//From 底(に届く) 権利, up 権利 手渡す 辛勝する/優位
//n.b. the "-1" s
Image1.Picture.Bitmap.canvas.pen.color:=clBlack;
Image1.Picture.Bitmap.canvas.moveto(iImageWidth-1,iImageHeight-1);
Image1.Picture.Bitmap.canvas.lineto(iImageWidth-1,40);

//From 底(に届く) 権利, left along 底(に届く) 辛勝する/優位
//n.b. the "-1" s
Image1.Picture.Bitmap.canvas.pen.color:=clLime;
Image1.Picture.Bitmap.canvas.moveto(iImageWidth-1,iImageHeight-1);
Image1.Picture.Bitmap.canvas.lineto(50,iImageHeight-1);

//Make an individual pixel 黒人/ボイコット...
//Look closely at the 審査する when you 宙返り飛行 for
//  this... the pixel may be very small
Image1.Picture.Bitmap.canvas.pixels[10,20] := clBlack;

//Text on a graphic...
//    A variety of "pen" 所有物/資産/財産s can be 始める,決める
//    before calling...
Image1.Picture.Bitmap.canvas.textout(10,30,'Hello');

That's it! Save what you have. 収集する and run it. You should see some lines.

And a very small 黒人/ボイコット dot, 近づく the upper left of the 製図/抽選 area. And some text 説 "Hello".


The above "explained"...

Once you have the "爆撃する" app above, if you 許す for the fact that the native 調整するs run from 0,0 at the upper left, you can use the に引き続いて. There are さまざまな 所有物/資産/財産s you can 始める,決める beforehand such as the color your "署名/調印する" will be, how wide lines will be, what typeface will be used, etc, etc.

But here are the basics, to get you started...

... and that's just for starters.

(If you don't like working from 0,0 at upper left, you can 簡単に create a small 機能(する)/行事 to calculate the 調整する the ソフトウェア needs from the system you want to use.)

The デモ in this tutorial will 陳列する,発揮する a window with a TImage 構成要素 on it, and draw some lines just inside the 辛勝する/優位s of the image, put a dot on the image, and put "Hello" on it.



Fishing for sympathy...

Will I never learn? About four hours ago, I was working on something in Delphi. I thought to myself, "I せねばならない 地位,任命する the essence of that in my Lazarus tutorial pages."(And since I wrote that, about three more hours have gone into just the "trivial" parts of wrapping this up... creating the とじ込み/提出するs to download, updating indices, smoothing rough 辛勝する/優位s.)

It should have been simple. This page. It was going to be just a simple untested 名簿(に載せる)/表(にあげる)ing showing the 核心 of what follows. I didn't think it needed much explanation.

The 核心 is....

1) Fill the に引き続いて 使用者 defined variables (See 十分な sourcecode, below. 特に, the "type... 私的な..." 封鎖する.) The canvas you are going to draw on, in this 実施, has to stay the same size all through the program's 死刑執行, but you can re-size the window to smaller than the canvas, and still have what you've drawn "there" when you scroll or make the window larger again.

iImageLeft:=50;
iImageTop:=10;
iImageWidth:=200;
iImageHeight:=100;

2) 遂行する/発効させる the に引き続いて once. I do it in the OnCreate handler for the form...

Image1.left:=iImageLeft;
Image1.最高の,を越す:=iImageTop;
Image1.width:=iImageWidth;
Image1.高さ:=iImageHeight;

(*Next, 割り当てる bitmap to the image...
This had 利益s in Delphi... I think it
was to do with getting what you see on
the 審査する to 生き残る re-sizings, etc.

Some examples of Lazarus graphics on the web
take a different approach... they 簡単に put
a bitmap 直接/まっすぐに on the main form. They don't
bother with the image... but they also
over-ride the built in "Paint" handler to do
it. I 港/避難所't 設立する problems with my "simpler" approach, at least not under Delphi, and this
little Lazarus "デモ" program 作品.

For the に引き続いて to work, you'll need a 使用者
defined 反対する called "Bitmap", of type Bitmap
(See 十分な sourcecode, below) *)

Bitmap:=TBitmap.create;//Create a bitmap 反対する
Bitmap.width:=iImageWidth;//割り当てる dimensions
Bitmap.高さ:=iImageHeight;

//In Delphi, bitmap background is white to begin with. 黒人/ボイコット in Lazarus
Bitmap.canvas.pen.color:=clWhite;//1 of 2 lines not needed in Delphi...
Bitmap.canvas.Rectangle(0,0,iImageWidth,iImageHeight);//2 of 2 not needed, Delphi

Image1.Picture.Graphic:=Bitmap; //割り当てる the bitmap to the image 構成要素

Once you have your bitmap on your image 構成要素, here are some of the 製図/抽選 "tricks" 利用できる to you. the examples also show you where "the 辛勝する/優位s" are.

You CAN do any of the に引き続いて as soon as you've done the above. You can do them in the OnCreate handler for the form, for instance. But you can also do them at any later time in the program's 死刑執行, so, for instance, new dots, lines, text, etc can appear (or disappear: You erase by "製図/抽選" in white the thing you want gone) in 返答 to 使用者 input, readings from sensors, etc.

//From 最高の,を越す left, across 最高の,を越す
Image1.Picture.Bitmap.canvas.pen.color:=clGreen;
Image1.Picture.Bitmap.canvas.moveto(0,0);
Image1.Picture.Bitmap.canvas.lineto(150,0);

//From 最高の,を越す left, along left 辛勝する/優位
Image1.Picture.Bitmap.canvas.pen.color:=clRed;
Image1.Picture.Bitmap.canvas.moveto(0,0);
Image1.Picture.Bitmap.canvas.lineto(0,60);

//From 底(に届く) 権利, up 権利 手渡す 辛勝する/優位
//n.b. the "-1" s
Image1.Picture.Bitmap.canvas.pen.color:=clBlack;
Image1.Picture.Bitmap.canvas.moveto(iImageWidth-1,iImageHeight-1);
Image1.Picture.Bitmap.canvas.lineto(iImageWidth-1,40);

//From 底(に届く) 権利, left along 底(に届く) 辛勝する/優位
//n.b. the "-1" s
Image1.Picture.Bitmap.canvas.pen.color:=clLime;
Image1.Picture.Bitmap.canvas.moveto(iImageWidth-1,iImageHeight-1);
Image1.Picture.Bitmap.canvas.lineto(50,iImageHeight-1);

//Make an individual pixel 黒人/ボイコット...
//Look closely at the 審査する when you 宙返り飛行 for
//  this... the pixel may be very small
Image1.Picture.Bitmap.canvas.pixels[10,20] := clBlack;

//Text on a graphic...
//    A variety of "pen" 所有物/資産/財産s can be 始める,決める
//    before calling...
Image1.Picture.Bitmap.canvas.textout(10,30,'Hello')

And that should have been that. Ha!

Then I 弱めるd, and thought "I'd better just check it really 作品.

There followed about three hours of 混乱. It stemmed mostly from the fact that Lazarus initializes the background of the 製図/抽選 area with 黒人/ボイコット, 反して Delphi initializes it white. What I 手配中の,お尋ね者 to do was probably "working", but I didn't notice it working against the 黒人/ボイコット.

So then I chased off, tried さまざまな things.

In the end, I think the Lazarus 見解/翻訳/版 (below) and the Delphi 見解/翻訳/版 (底(に届く) of page) only 異なる in that the Lazarus 見解/翻訳/版 has the two lines in it to initialize the 製図/抽選 "page" as white, not 黒人/ボイコット. But at this point, WELL out of time, I'm just 名簿(に載せる)/表(にあげる)ing both WORKING programs as they are...

The に引き続いて "just 作品". I put a TImage 構成要素 called Image1 on the form, apart from creating what you see below. Some of it was started for me by Lazarus, for instance the OnCreate handler's 骸骨/概要. (Created 経由で the 反対する 視察官.)

A zip とじ込み/提出する 含む/封じ込めるing the sourcecode and an .exe of LDNgraphics1 is 利用できる for download. It is 3721kb. The 同等(の)... nearly 同一の... Delphi zip was only 161kb. Sigh. But Delphi isn't multi-壇・綱領・公約.

部隊 LDNgraphics1u1;

(*Ver 27 Dec 13, 11:06, with extra comment 追加するd
 To go with...
 https://sheepdogguides.com/lut/lt1Graphics.htm
*)

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, 支配(する)/統制するs, Graphics, Dialogs, ExtCtrls,
  StdCtrls;

type
  { TForm1 }
    TForm1 = class(TForm)
    Image1: TImage;
    手続き FormCreate(Sender: TObject);
  私的な
    Bitmap:TBitmap;
    iImageLeft, iImageTop, iImageWidth, iImageHeight:integer;
    { 私的な 宣言s }
  public
    { public 宣言s }
  end;

var
  Form1: TForm1;

実施

{$R *.lfm}

{ TForm1 }

手続き TForm1.FormCreate(Sender: TObject);
begin
iImageLeft:=50;
iImageTop:=10;
iImageWidth:=200;
iImageHeight:=100;

Image1.left:=iImageLeft;
Image1.最高の,を越す:=iImageTop;
Image1.width:=iImageWidth;
Image1.高さ:=iImageHeight;

(*Next, 割り当てる bitmap to the image...
This had 利益s in Delphi... I think it
was to do with getting what you see on
the 審査する to 生き残る re-sizings, etc.

Some examples of Lazarus graphics on the web
take a different approach... they 簡単に put a bitmap
直接/まっすぐに on the main form. They don't bother
with the image... but they also over-ride the
built in "Paint" handler to do it. I 港/避難所't
設立する problems with my "simpler" approach, at
least not under Delphi, and this little
Lazarus "デモ" program 作品.*)

Bitmap:=TBitmap.create;//Create a bitmap 反対する
Bitmap.width:=iImageWidth;//割り当てる dimensions
Bitmap.高さ:=iImageHeight;

//In Delphi, bitmap background is white to begin with. 黒人/ボイコット in Lazarus
Bitmap.canvas.pen.color:=clWhite;//1 of 2 lines not needed in Delphi...
Bitmap.canvas.Rectangle(0,0,iImageWidth,iImageHeight);//2 of 2 not needed, Delphi

Image1.Picture.Graphic:=Bitmap; //割り当てる the bitmap to the image 構成要素

//That's our 製図/抽選 surface "用意が出来ている".
//Now do some "tricks" with what we have, and learn
//  where "the 辛勝する/優位s" of the drawable area are...

//From 最高の,を越す left, across 最高の,を越す
Image1.Picture.Bitmap.canvas.pen.color:=clGreen;
Image1.Picture.Bitmap.canvas.moveto(0,0);
Image1.Picture.Bitmap.canvas.lineto(150,0);

//From 最高の,を越す left, along left 辛勝する/優位
Image1.Picture.Bitmap.canvas.pen.color:=clRed;
Image1.Picture.Bitmap.canvas.moveto(0,0);
Image1.Picture.Bitmap.canvas.lineto(0,60);

//From 底(に届く) 権利, up 権利 手渡す 辛勝する/優位
//n.b. the "-1" s
Image1.Picture.Bitmap.canvas.pen.color:=clBlack;
Image1.Picture.Bitmap.canvas.moveto(iImageWidth-1,iImageHeight-1);
Image1.Picture.Bitmap.canvas.lineto(iImageWidth-1,40);

//From 底(に届く) 権利, left along 底(に届く) 辛勝する/優位
//n.b. the "-1" s
Image1.Picture.Bitmap.canvas.pen.color:=clLime;
Image1.Picture.Bitmap.canvas.moveto(iImageWidth-1,iImageHeight-1);
Image1.Picture.Bitmap.canvas.lineto(50,iImageHeight-1);

//Make an individual pixel 黒人/ボイコット...
//Look closely at the 審査する when you 宙返り飛行 for
//  this... the pixel may be very small
Image1.Picture.Bitmap.canvas.pixels[10,20] := clBlack;

//Text on a graphic...
//    A variety of "pen" 所有物/資産/財産s can be 始める,決める
//    before calling...
Image1.Picture.Bitmap.canvas.textout(10,30,'Hello');
end;

end.



Delphi 見解/翻訳/版

The に引き続いて "just 作品" in DELPHI. I put a TImage 構成要素 called Image1 on the form, apart from creating what you see below. Some of it was started for me in the usual way by Delphi, for instance the OnCreate handler's 骸骨/概要. (Created 経由で the 反対する 視察官.)

A zip とじ込み/提出する 含む/封じ込めるing the sourcecode and an .exe of LDNgraphics1Delphi is 利用できる for download. It is 161kb. The 同等(の)... nearly 同一の, in design and 機能(する)/行事... Lazarus zip was a staggering 3,721kb. Sigh. But Lazarus is multi-壇・綱領・公約.

I run the program, and I see a white rectangle within the form, with some lines along parts of 辛勝する/優位s, a dot, and "Hello".

As I said, I think this 異なるs from "the Lazarus 見解/翻訳/版" only in 欠如(する)ing the two lines during the 創造 of the image-with-bitmap which fill it with white 最初.

部隊 LDNgraphics1DelphiU1;
//指名する derived from fact that this is
// Delphi 同等(の) of LDNgraphics1, which
// was written to go with...

//https://sheepdogguides.com/lut/lt1Graphics.htm

(*Quick check of しっかり掴む of basic graphics, ver 28 Dec 13..
with tweak here not in downloadable 見解/翻訳/版. Remmed*)

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, 支配(する)/統制するs, Forms, Dialogs,
  ExtCtrls;

type
  TLDNgraphics1DelphiF1 = class(TForm)
    Image1: TImage;
    手続き FormCreate(Sender: TObject);
  私的な
    Bitmap:TBitmap;
    iImageLeft, iImageTop, iImageWidth, iImageHeight:integer;
   { 私的な 宣言s }
  public
    { Public 宣言s }
  end;

var
  LDNgraphics1DelphiF1: TLDNgraphics1DelphiF1;

実施

{$R *.DFM}

手続き TLDNgraphics1DelphiF1.FormCreate(Sender: TObject);
begin
iImageLeft:=20;
iImageTop:=10;
iImageWidth:=500;
iImageHeight:=300;

Image1.left:=iImageLeft;
Image1.最高の,を越す:=iImageTop;
Image1.width:=iImageWidth;
Image1.高さ:=iImageHeight;

Bitmap:=TBitmap.create;//Create a bitmap 反対する
Bitmap.width:=iImageWidth;//割り当てる dimensions
Bitmap.高さ:=iImageHeight;

(*Next, 割り当てる bitmap to the image...
This had 利益s in Delphi... I think it
was to do with getting what you see on
the 審査する to 生き残る re-sizings, etc.

Some examples of Lazarus graphics on the web
take a different approach... they 簡単に put a bitmap
直接/まっすぐに on the main form. They don't bother
with the image... but they also over-ride the
built in "Paint" handler to do it. I 港/避難所't
設立する problems with my "simpler" approach, at
least not under Delphi, and this little
Lazarus "デモ" program 作品.*)

Image1.Picture.Graphic:=Bitmap;//割り当てる the bitmap to the image 構成要素

//Start: Bit not in downloadable 見解/翻訳/版...

//In Delphi, bitmap background is white to begin with. //Background defaults 黒人/ボイコット in Lazarus. If you want
//  to change the background color to, say, red, you
//  can do it with...

Bitmap.canvas.pen.color:=clRed;
Bitmap.canvas.小衝突.color:=clRed;//makes for FILLED rectangle
Bitmap.canvas.Rectangle(0,0,iImageWidth,iImageHeight);

//... end of bit not in downloadable 見解/翻訳/版.

//That's our 製図/抽選 surface "用意が出来ている".
//Now do some "tricks" with what we have, and learn
//  where "the 辛勝する/優位s" of the drawable area are...

//From 最高の,を越す left, across 最高の,を越す
Image1.Picture.Bitmap.canvas.pen.color:=clGreen;
Image1.Picture.Bitmap.canvas.moveto(0,0);
Image1.Picture.Bitmap.canvas.lineto(300,0);

//From 最高の,を越す left, along left 辛勝する/優位
Image1.Picture.Bitmap.canvas.pen.color:=clRed;
Image1.Picture.Bitmap.canvas.moveto(0,0);
Image1.Picture.Bitmap.canvas.lineto(0,100);

//From 底(に届く) 権利, up 権利 手渡す 辛勝する/優位
//n.b. the "-1" s
Image1.Picture.Bitmap.canvas.pen.color:=clBlack;
Image1.Picture.Bitmap.canvas.moveto(iImageWidth-1,iImageHeight-1);
Image1.Picture.Bitmap.canvas.lineto(iImageWidth-1,50);

//From 底(に届く) 権利, left along 底(に届く) 辛勝する/優位
//n.b. the "-1" s
Image1.Picture.Bitmap.canvas.pen.color:=clLime;
Image1.Picture.Bitmap.canvas.moveto(iImageWidth-1,iImageHeight-1);
Image1.Picture.Bitmap.canvas.lineto(50,iImageHeight-1);

//Making an individual pixel 黒人/ボイコット...
Image1.Picture.Bitmap.canvas.pixels[10,20] := clBlack;

//Text on a graphic...
//    A variety of "pen" 所有物/資産/財産s can be 始める,決める
//    before calling...
Image1.Picture.Bitmap.canvas.textout(10,30,'Hello');

end;//FormCreate

end.

Remember: The code above is DELPHI code. The Lazarus 見解/翻訳/版 is at the 最高の,を越す of the page.




More?

If this didn't やめる get the ideas across for you, maybe try my older tutorial introducing 製図/抽選 graphics in Delphi? Lazarus graphics seem to match what Delphi did, at least in the basics.





Search across all my 場所/位置s with the Google search...

Custom Search

Or search just SheepdogGuides.com with the Freefind 道具...

   Search this 場所/位置 or the web          力/強力にするd by FreeFind
  場所/位置 search Web search
場所/位置 地図/計画する    What's New    Search

This search 単に looks for the words you enter. It won't answer "Where can I download InpOut32?"


If you visit 1&1's 場所/位置 from here, it helps me. They host my website, and I wouldn't put this link up for them if I wasn't happy with their service. They 申し込む/申し出 things for the beginner and the 会社/団体.www.1and1.com icon

広告 from page's editor: Yes.. I do enjoy 収集するing these things for you. I hope they are helpful. However... this doesn't 支払う/賃金 my 法案s!!! Sheepdog ソフトウェア (tm) is supposed to help do that, so if you 設立する this stuff useful, (and you run a Windows or MS-DOS PC) please visit my freeware and shareware page, download something, and 循環させる it for me? Links on your page to this page would also be 高く評価する/(相場などが)上がるd!
Click here to visit editor's freeware, shareware page.

Link to Lazarus Tutorials main page
How to 接触する the editor of this page, Tom Boyd


Valid HTML 4.01 Transitional Page has been 実験(する)d for 同意/服従 with INDUSTRY (not MS-only) 基準s, using the 解放する/自由な, 公然と accessible validator at validator.w3.org. Mostly passes.

AND passes... Valid CSS!


If this page 原因(となる)s a script to run, why? Because of things like Google パネル盤s, and the code for the search button. Why do I について言及する scripts? Be sure you know all you need to about spyware.

....... P a g e . . . E n d s .....