Ver Mensaje Individual
  #3  
Antiguo 20-09-2014
FabianSiza FabianSiza is offline
Miembro
NULL
 
Registrado: sep 2014
Posts: 41
Reputación: 0
FabianSiza Va por buen camino
a perdón cuando le doy al boton aplicar este le pone el texto y los cuadros a la imagen aca esta

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
  MyRect,MyRect2,MyRect3,MyRect4: TRectF;


begin

  MyRect := TRectF.Create(0, 0, 1000, 300);  //crea un rectangulo pos x, pos y , largo, alto
  MyRect2 := TRectF.Create(1000, 0, 1910, 300);  //crea un rectangulo pos x, pos y , largo, alto
  MyRect3 := TRectF.Create({borde iz}0, 2800, {largo}1000,2300);  //crea un rectangulo pos x, pos y , largo, alto
  MyRect4 := TRectF.Create(1910, 100000, 1000, 2300);  //crea un rectangulo pos x, pos y , largo, alto

 ImageControl1.Bitmap.Canvas.BeginScene;

//*******************************************
 ImageControl1.Bitmap.Canvas.Fill.Color := TAlphaColorRec.Black; //pinta el rectangulo
 ImageControl1.Bitmap.Canvas.FillRect(MyRect, 30, 60, [], 100); //dibuja el rectangulo
 //******************************************************

 //****************************************************
 ImageControl1.Bitmap.Canvas.Fill.Color := TAlphaColorRec.White; //pinta el texto
 ImageControl1.Bitmap.Canvas.Font.Size:=55;
 ImageControl1.Bitmap.Canvas.FillText(MyRect, 'NOMBRE: '+Edit1.Text,  false, 100,
 [TFillTextFlag.RightToLeft], TTextAlign.Center, TTextAlign.Center); //Agrega rectangulo y texto a la imagen
//*******************************************

//*******************************************
 ImageControl1.Bitmap.Canvas.Fill.Color := TAlphaColorRec.Red; //pinta el rectangulo
 ImageControl1.Bitmap.Canvas.FillRect(MyRect2, 30, 60, [], 100); //dibuja el rectangulo


 ImageControl1.Bitmap.Canvas.Fill.Color := TAlphaColorRec.White; //pinta el texto
  ImageControl1.Bitmap.Canvas.Font.Size:=50;
 ImageControl1.Bitmap.Canvas.FillText(MyRect2, 'CODIGO: '+Edit2.Text, false, 100,
 [TFillTextFlag.RightToLeft], TTextAlign.Center, TTextAlign.Center); //Agrega rectangulo y texto a la imagen
//*******************************************

//*******************************************
 ImageControl1.Bitmap.Canvas.Fill.Color := TAlphaColorRec.Black; //pinta el rectangulo
 ImageControl1.Bitmap.Canvas.FillRect(MyRect3, 30, 60, [], 100); //dibuja el rectangulo

 ImageControl1.Bitmap.Canvas.Fill.Color := TAlphaColorRec.White; //pinta el texto
  ImageControl1.Bitmap.Canvas.Font.Size:=55;
 ImageControl1.Bitmap.Canvas.FillText(MyRect3,'MEDIDAS: '+Edit3.Text, false, 100,
 [TFillTextFlag.RightToLeft], TTextAlign.Center, TTextAlign.Center); //Agrega rectangulo y texto a la imagen
//*******************************************

//*******************************************
 ImageControl1.Bitmap.Canvas.Fill.Color := TAlphaColorRec.Red; //pinta el rectangulo
 ImageControl1.Bitmap.Canvas.FillRect(MyRect4, 30, 60, [], 100); //dibuja el rectangulo

 ImageControl1.Bitmap.Canvas.Fill.Color := TAlphaColorRec.White; //pinta el texto
  ImageControl1.Bitmap.Canvas.Font.Size:=55;
 ImageControl1.Bitmap.Canvas.FillText(MyRect4,'PRECIO: '+Edit4.Text, false, 100,
 [TFillTextFlag.RightToLeft], TTextAlign.Center, TTextAlign.Center); //Agrega rectangulo y texto a la imagen
//*******************************************



  ImageControl1.Bitmap.Canvas.EndScene;
 

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
OpenDialog1.Execute;
if OpenDialog1.FileName <> '' then
ImageControl1.Bitmap.LoadFromFile(OpenDialog1.FileName);

este es mi codigo pero como decia no se ajusta automaticamente a el tamaño de las imagenes asi que el texto y los cuadros se pierden y se distrocionan creo que el Timagencontrol tiene algo para reconocer eso
Responder Con Cita