Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Начинающим";
Текущий архив: 2005.09.04;
Скачать: [xml.tar.bz2];

Вниз

Image   Найти похожие ветки 

 
Serjio   (2005-08-05 16:20) [0]

Подскажите пожалуйста, что нужно вписать в скобки в этом коде:

Image1.Canvas.Draw();

Вернее не что а как это сделать?


 
alles ©   (2005-08-05 16:26) [1]

for example:
procedure TForm1.Button1Click(Sender: TObject);

var
 Bitmap : TBitMap;
begin
 Bitmap := TBitmap.Create;
 try
   with Bitmap do begin
     LoadFromFile("MyBitmap.png");
     Transparent := True;
     TransParentColor := BitMap.Canvas.Brush.Color;
     Form1.Canvas.Draw(0,0,BitMap);
     TransparentMode := tmAuto;
     Form1.Canvas.Draw(50,50,BitMap);
   end;
 finally
   Bitmap.Free;
 end;
end;


 
Ega23 ©   (2005-08-05 16:26) [2]


TCanvas.Draw

Renders the graphic specified by the Graphic parameter on the canvas at the location given by the coordinates (X, Y).

procedure Draw(X, Y: Integer; Graphic: TGraphic);

Description

Call Draw to draw a graphic on the canvas. Draw calls the Draw method of the graphic. The image is rendered into a rectangle determined by the size of the graphic, with the upper left corner at the point (X, Y).

Graphics can be bitmaps, icons, or metafiles. If the graphic is a TBitmap object, the bitmap is rendered using the value of CopyMode.


Example:


procedure TForm1.Button1Click(Sender: TObject);

var
 Bitmap : TBitMap;
begin
 Bitmap := TBitmap.Create;
 try
   with Bitmap do begin
     LoadFromFile("c:\Program Files\Common Files\Borland Shared\Images\Splash\256color\factory.bmp");
     Transparent := True;
     TransParentColor := BitMap.canvas.pixels[50,50];
     Form1.Canvas.Draw(0,0,BitMap);
     TransparentMode := tmAuto;   // Transparent color now is clDefault = TColor($20000000);
     Form1.Canvas.Draw(50,50,BitMap);

   end;
 finally
   Bitmap.Free;
 end;
end;


 
McSimm ©   (2005-08-05 16:26) [3]

Попробуй рисовать на холсте не Image1, а Image1.Picture.Bitmap


 
Ega23 ©   (2005-08-05 16:53) [4]

2 McSimm ©   (05.08.05 16:26) [3]

Почему?????


 
Ega23 ©   (2005-08-05 16:54) [5]

А, это TImage.... Мне показалось TPaintBox....   :о)



Страницы: 1 вся ветка

Форум: "Начинающим";
Текущий архив: 2005.09.04;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.011 c
10-1101710610
Сергей Г
2004-11-29 09:43
2005.09.04
Последняя не пустая ячейка


2-1123234342
Smersh03-1
2005-08-05 13:32
2005.09.04
Летающие формы


1-1123944383
tazik
2005-08-13 18:46
2005.09.04
Как выделить слова из KAК-файла


4-1121495804
Михаил(Киров)
2005-07-16 10:36
2005.09.04
Запуск процесса


1-1123239946
afanasic
2005-08-05 15:05
2005.09.04
Как сделать, чтобы окно отображалось поверх TaskBar?





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 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
Английский Французский Немецкий Итальянский Португальский Русский Испанский