|  | 
 
 | 
| 
 | |||||||
| Регистрация | << Правила форума >> | FAQ | Пользователи | Календарь | Поиск | Сообщения за сегодня | Все разделы прочитаны | 
|  | 
|  | Опции темы | Поиск в этой теме | Опции просмотра | 
| 
			 
			#1  
			
			
			
			
		 | ||||
| 
 | ||||
|  Как отразить TBitmap с лева на право? Как отразить TBitmap с лева на право? | 
| 
			 
			#2  
			
			
			
			
		 | ||||
| 
 | ||||
|   Помещаете на форму 2 компонента TImage и TButton: Код: procedure TForm1.Button1Click(Sender: TObject);
var
Bitmap: TBitmap;
i, j: Integer;
begin
Image1.Picture.LoadFromFile('C:/example.bmp');
Bitmap:=TBitmap.Create;
with Image1 do
begin
Bitmap.Height:=Height;
Bitmap.Width:=Width;
for i:=0 to Width-1 do
for j:=0 to Height-1 do
Bitmap.Canvas.Pixels[Width-i, j]:=Image1.Canvas.Pixels[i,j];
Image2.Picture.Assign(Bitmap);
end;
end; | 
| 
			 
			#3  
			
			
			
			
		 | |||
| 
 | |||
|   Да... спосибо | 
| 
			 
			#4  
			
			
			
			
		 | |||
| 
 | |||
|   Код: procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
  PaintBox1.Canvas.CopyRect(Rect(PaintBox1.Width, 0, 0, PaintBox1.Height),
    Image1.Picture.Bitmap.Canvas,
    Image1.ClientRect);
end;Последний раз редактировалось AlexSku, 10.06.2008 в 12:33. | 
| 
			 
			#5  
			
			
			
			
		 | ||||
| 
 | ||||
|   Код: procedure flip_horizontal(Quelle, Ziel: TBitMap);
 begin
   Ziel.Assign(nil);
   Ziel.Width  := Quelle.Width;
   Ziel.Height := Quelle.Height;
   StretchBlt(Ziel.Canvas.Handle, 0, 0, Ziel.Width, Ziel.Height, Quelle.Canvas.Handle,
     0, Quelle.Height, Quelle.Width, Quelle.Height, srccopy);
 end;
 procedure flip_vertikal(Quelle, Ziel: TBitMap);
 begin
   Ziel.Assign(nil);
   Ziel.Width  := Quelle.Width;
   Ziel.Height := Quelle.Height;
   StretchBlt(Ziel.Canvas.Handle, 0, 0, Ziel.Width, Ziel.Height, Quelle.Canvas.Handle,
     Quelle.Width, 0, Quelle.Width, Quelle.Height, srccopy);
 end;(c) delphiworld  | 
| 
			 
			#6  
			
			
			
			
		 | ||||
| 
 | ||||
|   Код:  procedure TForm1.Button1Click(Sender: TObject);
 var
   temp: TBitMap;
 begin
   temp := TBitMap.Create;
   try
     temp.Assign(Image1.Picture.BitMap);
     flip_vertikal(Temp, Image1.Picture.Bitmap);
   finally
     Temp.Free;
   end;
 end; |