Autor Beitrag
CarpeDiem
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 128

WIN XP
Borland C++ 2002, CodeGear C++ 2007, C# (VS 2008)
BeitragVerfasst: Fr 14.03.08 07:37 
Hallo,

ich habe ein Programm geschrieben, daß mir ein Bild von der Festplatte in ein
TBitmap-Objekt einliest:

Bitmap->LoadFromFile("C:\\....");


Das Problem ist, daß das Bild von einer Kamera aufgenommen wurde, die nur
Grautöne(0-255) aufnehmen kann(Industrie).


Wenn ich jetzt versuche über

Bitmap->Canvas->Pen->Color = clRed;
Bitmap->Canvas->MoveTo(10,10);
Bitmap->Canvas->LineTo(25,25);

eine Linie in das Bild zu zeichnen, wird der Strich in einen Grauton umgewandelt.


Wie kann ich einem TBitmap-Objekt sagen, daß es ein 24Bit-Farbbild sein soll.




Stefan


Moderiert von user profile iconGausi: Topic aus Algorithmen, Optimierung und Assembler verschoben am Fr 14.03.2008 um 09:11
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Fr 14.03.08 08:07 
ausblenden Delphi-Quelltext
1:
TBitmap.PixelFormat := pf24Bit;					

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
CarpeDiem Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 128

WIN XP
Borland C++ 2002, CodeGear C++ 2007, C# (VS 2008)
BeitragVerfasst: Fr 14.03.08 08:55 
Vielen Dank, so einfach gehts.