Autor Beitrag
Andreas_Sans
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Mi 17.03.04 01:44 
Hi,

ich möchte eine eigene Komponente erstellen. Sie soll so ähnlich sein wie ein BitButton, aber bei meiner Komponente sollen die Bilder die angezeigt werden können schon vorgegeben sein und über eine eigenschaft aufgerufen werden.
z.B.:
    bei eigenschaft = 1 soll bild 1 angezeigt werden
    bei eigenschaft = 2 soll bild 2 angezeigt werden
    bei eigenschaft = 3 soll bild 3 angezeigt werden
    bei eigenschaft = 4 soll bild 4 angezeigt werden

Kann mir jemand helfen oder ein gutes tutorial empfehlen ?


Zuletzt bearbeitet von Andreas_Sans am Sa 20.03.04 17:44, insgesamt 1-mal bearbeitet
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mi 17.03.04 09:20 
wenns sonst nichts ist, so verwende doch die Tags.

_________________
Gruß
Hansa
Andreas_Sans Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Mi 17.03.04 12:20 
du meinst z.B.: if bitbtn1.tag = 1 then bitbtn1.glyph.loadfromfile(blablabla);

aber genau das laden der bitmap will ich mir ersparen. die bitmaps sollen schon ein Teil der Komponente sein und nicht mehr geändert werden können
adler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: Mi 17.03.04 12:57 
Da gibts doch ne Componente wo du Bilder einspeichern kannst!
PictureList oder ImageList, weiß nicht mehr genau wie das heißt.. dort machst du sie rein und gut ist!
Da brauchste nix laden.

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mi 17.03.04 19:32 
wenn du so was selber machen willst, das geht auch. Dann mußt Du dich aber anstrengen. Der Chefcoder in dem Bereich ist Motzi. Der hilft Dir bestimmt. Wenn du genau sagst was du willst, kriege ich es auch hin. 8)

_________________
Gruß
Hansa
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mi 17.03.04 21:55 
Spezifizier ein bisschen genauer was du machen willst.. wenn es dir nur darum geht vorgefertigte Bilder in deiner Komponente zu verwenden die aber nicht extra auf der Platte liegen sollen wäre das einfachste eine Resource-Datei die du über deine Komponenten-Unit in die Exe miteinlinkst und die Bilder dann da rausladest (entweder per TResourceStream oder direkt per API).

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Andreas_Sans Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Sa 20.03.04 13:41 
@ Motzi : genau so wollte ich es machen, dass die Bilder schon bei der Komponente dabei sind und nicht irgendwo auf der Platte liegen müssen.

und wie macht man das was du beschrieben hast (ressource-datei, exe-einlinken, rausladen) ?

kennt jemand ein Tutorial zur erstellung einer Ressource-datei ?
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Sa 20.03.04 13:58 
Such mal ein bisschen hier im Forum.. das Thema Resourcen taucht hier immer wieder auf..!

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Andreas_Sans Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Sa 20.03.04 15:41 
ok hab was gefunden danke