Autor Beitrag
Lupin003
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Fr 21.11.03 00:17 
Ich bräuchte mal ein Beispiel das mir zeigt wie man DIB sections benutzt um Pixel auf ein Fenster zu zeichnen. Da ich glaube das die Pixel-property des standard fensters von Delphi Get/Set-Pixel verwendet glaube ich das das ziemlich lahm ist, deshalb will ich DIB benutzen.

Ich hab bereits ein paar Versuche unternommen, aber immer wenn ich den Pointer dereferenzieren will sagt er mir das ich einen Array typen brauche (Warum kann Delphi nicht mit Pointern als Array arbeiten? Macht C doch auch ohne Probleme :()

Danke :)

_________________
n00b alarm ;P
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Di 09.12.03 20:24 
Hallo,

tja, "Delphi != Cpp", aber man kann abhelfen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
type
  PMyArray = ^TMyArray;
  TMyArray = array[0..9999] of Integer;
var
  P: PMyArray;
  I: Integer;
begin
  P := @Something;
  I := P[100]^;

Und zu deinen DIBs: warum willst du grade DIB-Sections zeichnen? Nimm ein TtBitmap, und zeichne es! Direkt auf das Fenster?
ausblenden Delphi-Quelltext
1:
TForm1.Canvas.Draw(100, 100, Bitmap1);					

Oder verstehe ich dich nicht richtig...?

_________________
Life is a bad adventure, but the graphic is really good!
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: Di 09.12.03 21:16 
bevor die Frage kommt:

Andreas Pfau hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
I := P[100]^;					


sollte

ausblenden Delphi-Quelltext
1:
I := P^[100];					


heißen.
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Di 09.12.03 21:37 
Hallo,

:oops: kann mal passieren... sollte aber nicht! *schäm*

Aber einen hab' ich noch: Bevor du einen Array auf Bytes oder Words deklarierst - die gibt es schon, in der Unit "SysUtils", heißen "PByteArray" bzw. "PWordArray"!

_________________
Life is a bad adventure, but the graphic is really good!