Autor Beitrag
nepleurepas
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

Win XP

BeitragVerfasst: Sa 13.09.08 13:47 
Hallo,
ich möchte ein Bitmap so verändern, dass jeder pixel, der nicht weiß ist, schwarz wird.
Hierfür wollte ich so anfangen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
var bild: Tbitmap;
begin
bild.create;
if opendialog1.execute then bild.loadfromfile(opendialog1.filename);


und dann halt mit canvas.pixels usw die einzelnen pixel durcharbeiten.

NUr leider kommt schon wenn ich nur die variable bild belegen will eine Fehlermeldung mit "raised execption class ..."


Was mache ich falsch?
Danke für Antworten
Stefan
freak4fun
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 604
Erhaltene Danke: 4

Win 7 Pro
VS 2013 Express, Delphi, C#, PHP, Java
BeitragVerfasst: Sa 13.09.08 13:52 
ausblenden Delphi-Quelltext
1:
bild := TBitMap.create;					


Edit: Grundlagen

_________________
"Ich werde auf GAR KEINEN Fall…!" - "Keks?" - "Okay, ich tu's."
i++; // zaehler i um 1 erhoehen


Zuletzt bearbeitet von freak4fun am Sa 13.09.08 13:56, insgesamt 1-mal bearbeitet
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 13.09.08 13:52 
bild := TBitmap.Create; ;-)

Edit: zu langsam. :bawling:

_________________
We are, we were and will not be.
nepleurepas Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

Win XP

BeitragVerfasst: Sa 13.09.08 13:56 
user profile iconGausi hat folgendes geschrieben:
bild := TBitmap.Create; ;-)

Edit: zu langsam. :bawling:


awright, danke.
KLeine Frage noch. Warum zeigt mir Delphi "bild.create" in der auswahlliste an? Was passiert denn wirklich, wenn ich dies mache? Nur zum Verständnis...
freak4fun
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 604
Erhaltene Danke: 4

Win 7 Pro
VS 2013 Express, Delphi, C#, PHP, Java
BeitragVerfasst: Sa 13.09.08 13:59 
user profile iconnepleurepas hat folgendes geschrieben:
KLeine Frage noch. Warum zeigt mir Delphi "bild.create" in der auswahlliste an? Was passiert denn wirklich, wenn ich dies mache? Nur zum Verständnis...

Du rufst den Constructor für das Objekt bild auf, obwohl dies noch gar nicht initialisiert ist.

Moderiert von user profile iconNarses: Zitat gekürzt

_________________
"Ich werde auf GAR KEINEN Fall…!" - "Keks?" - "Okay, ich tu's."
i++; // zaehler i um 1 erhoehen
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Sa 13.09.08 14:01 
ein bisschen ot aber ich machs trotzdem :-P : Wenn du viele Pixel bearbeiten willst ist scanline besser, da es eine deutlich bessere performance hat als canvas.pixels.

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
nepleurepas Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

Win XP

BeitragVerfasst: Sa 13.09.08 14:03 
user profile iconelundril hat folgendes geschrieben:
ein bisschen ot aber ich machs trotzdem :-P : Wenn du viele Pixel bearbeiten willst ist scanline besser, da es eine deutlich bessere performance hat als canvas.pixels.

lg elundril

okay