no Delphi o BrushCopy faz a mesma coisa q no C ?
[b:f2666b0e07]Ola Rapazes... eu denovo![/b:f2666b0e07]
em Delphi:
[color=red:f2666b0e07]
[b:f2666b0e07]tá dando erro:Missing operator or semicolon[/b:f2666b0e07][/color:f2666b0e07]
em C:
tenho N perguntas:
[b:f2666b0e07]
[color=brown:f2666b0e07]no C ++ o BrushCopy faz a mesma coisa q no Delphi?[/color:f2666b0e07][/b:f2666b0e07][b:f2666b0e07] [color=green:f2666b0e07]E se nao, qual q substitui?[/color:f2666b0e07][/b:f2666b0e07]
[b:f2666b0e07]
bmp.width no c++ eh o bmp.bmWidth no Delphi?
Please... Help-me!!!!!!!!!
[/b:f2666b0e07]
Var bmp: TBitmap; esq, topo: Extended; bmp := TBitmap( Pointer( Integer( Self.objects[ aCol, aRow ] ) )^ ); topo:= (Rect.top + ((Rect.Bottom - Rect.Top) - bmp.bmHeight)/2); esq:= Rect.Left + 3;
em Delphi:
Self.Canvas.BrushCopy(Rect(esq, topo, (esq + bmp.bmWidth), (topo + bmp.bmHeight)), bmp, Rect(0,0,bmp.bmWidth,bmp.bmHeight), bmp.Canvas.Pixels[0][bmp.bmHeight-1]);
[color=red:f2666b0e07]
[b:f2666b0e07]tá dando erro:Missing operator or semicolon[/b:f2666b0e07][/color:f2666b0e07]
em C:
this->Grid->Canvas->BrushCopy(TRect(esq, topo, esq + bmp->Width, topo + bmp->Height), bmp, TRect(0,0,bmp->Width,bmp->Height), bmp->Canvas->Pixels[0][bmp->Height-1]);
tenho N perguntas:
[b:f2666b0e07]
[color=brown:f2666b0e07]no C ++ o BrushCopy faz a mesma coisa q no Delphi?[/color:f2666b0e07][/b:f2666b0e07][b:f2666b0e07] [color=green:f2666b0e07]E se nao, qual q substitui?[/color:f2666b0e07][/b:f2666b0e07]
[b:f2666b0e07]
bmp.width no c++ eh o bmp.bmWidth no Delphi?
Please... Help-me!!!!!!!!!
[/b:f2666b0e07]
Michelli88
Curtidas 0
Respostas
Nildo
04/07/2005
Pode usar o Canvas.CopyRect mesmo
GOSTEI 0
Michelli88
04/07/2005
[b:7a481f97c7]Tinha dois problemas no meu código:[/b:7a481f97c7]
[color=red:7a481f97c7][b:7a481f97c7]Um era a funçao Rect... tinha uma variavel com o mesmo nome:[/b:7a481f97c7][/color:7a481f97c7]
tinha sido declarado no evento, o Rect:TRect... dai o delphi confundia com a função Rect.
O outro problema, e mais surpreendente...
[b:7a481f97c7]
[color=red:7a481f97c7]O Delphi nao tava reconhecendo o, tagBitmap e Bitmap, bmp.canvas, nem o bmp.Height por exemplo...[/color:7a481f97c7][/b:7a481f97c7]
[color=indigo:7a481f97c7][b:7a481f97c7]Descobri que na declaração das units, Graphics tem q estar depois da Windows...[/b:7a481f97c7]
[/color:7a481f97c7]
Vejam:
[b:7a481f97c7]Bom, problema resolvido, o codigo ficou assim:[/b:7a481f97c7]
[b:7a481f97c7] Que coisa né!
Valeu Nildo...[/b:7a481f97c7]
[color=red:7a481f97c7][b:7a481f97c7]Um era a funçao Rect... tinha uma variavel com o mesmo nome:[/b:7a481f97c7][/color:7a481f97c7]
procedure TPTNGrid.GridDrawCell(Sender:TObject; ACol: Integer; ARow: Integer; Rect: TRect; State: TGridDrawState); //mudei para Rect1
tinha sido declarado no evento, o Rect:TRect... dai o delphi confundia com a função Rect.
O outro problema, e mais surpreendente...
[b:7a481f97c7]
[color=red:7a481f97c7]O Delphi nao tava reconhecendo o, tagBitmap e Bitmap, bmp.canvas, nem o bmp.Height por exemplo...[/color:7a481f97c7][/b:7a481f97c7]
[color=indigo:7a481f97c7][b:7a481f97c7]Descobri que na declaração das units, Graphics tem q estar depois da Windows...[/b:7a481f97c7]
[/color:7a481f97c7]
Vejam:
It´s a problem with your uses clause in that module. The Windows unit
defines ´TBitmap = tagBitmap´, so you need to have the
Graphics unit appear
after Windows.
Cheers,
Carl
[b:7a481f97c7]Bom, problema resolvido, o codigo ficou assim:[/b:7a481f97c7]
Rect2:=Rect(esq, topo, (esq + bmp.Width), (topo + bmp.Height)); Self.Canvas.BrushCopy(Rect2, bmp, Rect(0,0,bmp.Width,bmp.Height), (bmp.Canvas.Pixels[0,bmp.Height-1]));
[b:7a481f97c7] Que coisa né!
Valeu Nildo...[/b:7a481f97c7]
GOSTEI 0