Author Topic: Re:[SOLVED] with CAUTION - I need a pointer for asm.  (Read 1368 times)


  • Jr. Member
  • **
  • Posts: 92
Re:[SOLVED] with CAUTION - I need a pointer for asm.
« on: October 23, 2015, 05:06:52 pm »
To access a TBGRABitmap in ASM use a PBGRAPixel pointer:
Var PMyBGRA: PBGRAPixel;..
PMyBGRA := MYBGRAImage.Data; //writes upwards from bottom line.
ASM... mov edi/esi,PMyBGRA... End;
Which is the same as:
Var PMyBGRA: PBGRAPixel;...
PMyBGRA := MYBGRAImage.Scanline[MYBGRAImage.height-1]; //so Delphi compatible. edi/esi,PMyBGRA...End;

BUT CAUTION -> PMyBGRA := MYBGRAImage.Scanline[0]; //is top line writing upwards so don't write more than the Image.Width!!

To access a TLazIntfImage in ASM use a PByteArray pointer:
Var PMyLazIntf: PByteArray;...
PMyLazIntf := MyIntfImage.GetDataLineStart(0); //top line and writes downwards. edi/esi,PMyLazIntf...End;

Credit goes to GetMem - and of course the Lazarus Team - Best to all - RWC.

Create TBGRABitmap:
Create TLazIntfImage:
LAZARUS  : Lazarus-1.4.2-fpc-2.6.4-win32. OS   : Windows Vista 32bit Home Premium SP2.
CPU  : Intel Core2 Quad CPU Q6600 2.4GHz. RAM : 3GB. PCIE : NVIDIA GeForce GT610. Audo : NVIDIA HD Audio.


TinyPortal © 2005-2018