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.83 MB
Time: 0.041 c
3-21950
Hermit
2001-12-05 11:38
2002.01.08
Implicitly Started Transactions


3-21976
Termik
2001-12-06 11:47
2002.01.08
Stored procedures, dynamic objects


3-21975
Dr. Web
2001-12-06 09:12
2002.01.08
creating Interbase database from the program


3-21943
Oleon
2001-12-05 10:54
2002.01.08
How to use TableLevel?


4-22485
delphixnumx
2001-11-05 06:56
2002.01.08
How can I load my cursor in the Delphi!





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 Español swahili Swedish thai turkish Ukrainian urdu vietnamese 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