Ver Mensaje Individual
  #1  
Antiguo 03-12-2016
andrecuellar andrecuellar is offline
Miembro
NULL
 
Registrado: sep 2015
Posts: 13
Reputación: 0
andrecuellar Va por buen camino
Talking Diferencias de TCanvas en Android y TCanvas en Windows (rectangle y draw)

Buenas, estoy experimentando por primera vez lo que sería programar para Android con delphi, estaba usando TCanvas y tengo dos problemas, uno para dibujar rectángulo y otro para dibujar las figuras, mi código es este:

Código Delphi [-]
Procedure CJuego.DibujarPieza(pant:Tcanvas;f: Integer; c: Integer);
var
rx,ry:integer;
letra:char;
figura:TBitMap;
begin
   rx:=px+(c-1)*60;
   ry:=py+(f-1)*60;
   pant.Rectangle(rx,ry,rx+60,ry+60);
   letra:=M[F,C];
   //pant.TextOut(rx+5,ry+5,letra);
   figura:=TBitmap.Create;
   if letra='P' then figura.LoadFromFile('C:\...\pared.bmp');
   if letra='C' then figura.LoadFromFile('C:\...\pasto.bmp');
   if letra='B' then figura.LoadFromFile('C:\...\bicho.bmp');
   if letra='X' then figura.LoadFromFile('C:\...\caja.bmp');
   if letra='x' then figura.LoadFromFile('C:\...\caja.bmp');
   if letra='b' then figura.LoadFromFile('C:\...\bicho.bmp');
   if letra='D' then figura.LoadFromFile('C:\...\Destino.bmp');
   pant.Draw(rx,ry,figura);
end;

Los errores que me muestran son en
Código Delphi [-]
pant.Rectangle(rx,ry,rx+60,ry+60);
y en
Código Delphi [-]
pant.Draw(rx,ry,figura);
donde dice que TCanvas no contiene un miembro llamado "rectangle" ni "draw"

Donde en Windows todo funciona y corre perfectamente

He encontrado algunas opciones interesantes que son drawbitmap pero me pide datos distintos, quisiera conocer las alternativas de windows a android en rectangle y draw de tipo TCanvas, gracias de antemano

Responder Con Cita