Einzelnen Beitrag anzeigen

TurboMagic

Registriert seit: 28. Feb 2016
Ort: Nordost Baden-Württemberg
2.824 Beiträge
 
Delphi 12 Athens
 
#2

AW: How to get Integer from Pointer

  Alt 23. Nov 2022, 18:50
1. I'm not sure why you're posting in English here, when there's an English forum over at en.delphipraxis.net but welcome here anyway.

2. Why don't you declare a pointer to that TRGBType and let that one point to the scanline property? By incremeinting that pointer you can scan 4 bytes forwards then.

Something like this one:

Delphi-Quellcode:
type
  TRGBColor = Integer;
var
  pFirstByte:^TRGBColor;
  MyColor: TRGBColor;
begin
  pFirstByte := DWORD(bm1.scanline[0]);
  MyColor := pFirstByte^;
  inc(pFirstByte); // point to the next color(s)
  MyColor := pFirstByte^;
  Mit Zitat antworten Zitat