Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

Has anyone used the PaintTo function to draw WinControls on a canvas bitmap? Help! I can’t do anything. Find similar branches


Kost   (2001-12-14 14:10) [0]

Has anyone used the PaintTo function to draw WinControl "s on a canvas bitmap? Help! I can't do anything.



valery_f   (2001-12-14 18:16) [1]

Enjoyed. The only "but" is that the initially invisible WinControl does not have a handle and gives an ex- tersion at PaintTo. If this is your component - call CreateHandle, if not - make it visible then hide it - the handle will appear and PaintTo will work.



DK   (2001-12-15 03:52) [2]

2valery_f
Can i ask you:
Like this? There is a control, but there is no handle. Is this possible?



Kost   (2001-12-15 13:05) [3]

There is a form TForm1. On it is placed the "experimental button" BitBtn1.
There is a desire, by clicking on another button - Button1 to do the following:
- draw a BitBtn1 image onto a canvas bitmap canvas using PaintTo
- bring the resulting bitmap to the outline of the form

DOES NOT WORK! BitBtn1 is not drawn in bitmap! WHY! WHERE AM I AM NOT RIGHT?

procedure TForm1.FormCreate (Sender: TObject);
begin
// Create a bitmap
bmp: = TBitmap.Create;
bmp.Width: = 150;
bmp.Height: = 150;
end;

procedure TForm1.Button1Click (Sender: TObject);
begin
// When you click on the button, draw BitBtn1 on the canvas bitmap
BitBtn1.PaintTo (bmp.Canvas.Handle, 0, 0);
Invalidate; // To cause the form to be redrawn
end;

procedure TForm1.FormPaint (Sender: TObject);
begin
// Display the bitmap form
Canvas.Draw (0,0, bmp);
end;



DK   (2001-12-16 02:26) [4]

Everything is working!!!
Maybe you just do not handle pressing a button?
procedure TForm1. Button1Click(Sender: TObject);
procedure TForm1. BitBtn1Click(Sender: TObject);



Kost   (2001-12-16 12:12) [5]

And, all the same, does not work. The button in bitmap is not drawn. TPanel is drawn and TButton and TBitBtn are not.



Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top





Memory: 0.56 MB
Time: 0.022 c
14-22364
Merlin
2001-11-06 00:22
2002.01.08
If you do not save, then it will be gone!


1-22062
Alexander
2001-12-19 00:17
2002.01.08
How can I add N days to a certain (TDateTime) date?


14-22407
KL
2001-11-03 00:47
2002.01.08
Beta Testing !!!


1-22113
Yuraz
2001-12-19 20:25
2002.01.08
Brothers why


14-22379
Felix
2001-11-05 19:54
2002.01.08
Show me - Maybe not? -Show you say!





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic Indonesian Irish italian Japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Spanish swahili Swedish ภาษาไทย turkish Ukrainian urdu Tiếng Việt welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada Khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish