Autor Beitrag
Stefan-W
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Fr 02.09.05 14:57 
Hi,

ich hab ein Problem mit der Image-Kompo. Diese bringt mir unter XP kein richtiges Transparent zusammen.

Ich hab eine Image-Kompo die als Hintergrundbild gedacht ist, davor hab ich noch ein Image (wo das mit der Transparenz nicht stimmt).

Ich selber nutze Win2K da geht alles wunderbar aber bei meinem Vater aufm PC mit XP geht die Transparenz des Bildes (was auf den Hintergrund kommt nicht)

hier mal der Code wie ich das Bild (wo die Transparenz nicht geht) erstelle
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
{...}
Procedure TF_Options.IconCasch(Menu: Integer);
Var
    Bitmap: TBitmap;
    Icon: Array[1..30] Of TIcon;
    I, J, K, X, Y: Integer;
Begin
    Bitmap := TBitmap.Create;
    Bitmap.Height := 182;
    Bitmap.Width := 219;
    Bitmap.Canvas.Brush.Style := bsClear;
    Bitmap.Canvas.FillRect(Bitmap.Canvas.ClipRect);
    For I := 1 To 30 Do                                                         // Icons setzen
    Begin
        Icon[I] := TIcon.Create;
        Icon[I].Handle := ExtractIcon(Application.Handle, PChar(TRunMenus[Menu - 1].Progs[I].Icon), TRunMenus[Menu - 1].Progs[I].IconNr);
    End;
    X := 1;
    Y := 1;
    For J := 1 To 30 Do
    Begin
        Bitmap.Canvas.Draw(X, Y, Icon[J]);
        X := X + 37;
        If X > 218 Then
        Begin
            X := 1;
            Y := Y + 37;
        End;
    End;
    For K := 1 To 30 Do
        Icon[K].Free;
    Bitmap.SaveToFile(ExePfad.Arbeitsverzeichnis + IntToStr(Menu) + '.dat');
    Bitmap.Free;
{...}


Und hier noch der Code womit ich das Bild dann lade (ist in einem anderen Programm)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
{...}
  I_Menu.Transparent := True;                                             // Hintergrund auf Durchsichtig
        I_Menu.Picture.Bitmap.LoadFromFile(ExePfad.Arbeitsverzeichnis + '1.dat'); // IconCash laden
{...}


und hier noch paar infos zu meinen nun doch weng ausgefallenen Variablen
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Type
    TTRUNProg = Record                                                          // Programm Variable
        Name: String;
        Prog: String;
        Param: String;
        Icon: String;
        IconNr: Integer;
    End;

Type
    TTRUNMenu = Record                                                          // Menü Variable
        Titel: String;
        Progs: Array[1..30] Of TTRUNProg;
    End;

Var 
    TRunMenus: Array Of TTRUNMenu;


Ich hoffe mir ist noch zuhelfen :wink:
Schonmal meinen Dank im Vorraus

Tschau Stefan


Zuletzt bearbeitet von Stefan-W am So 04.09.05 12:00, insgesamt 1-mal bearbeitet
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Sa 03.09.05 11:09 
mir fällt noch ein, dass ich in dem Programm welches mir das fehlerhafte Bild anzeigt kein XPManifest enthalten ist (was aber eigentlich nicht stören dürfte...

ich hänge mal noch ein Srceenshot von meinen Vater seinem Rechner an, um meinen Fehler zu verdeutlichen
Einloggen, um Attachments anzusehen!
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Sa 03.09.05 11:18 
und wo auf dem bild ist der fehler ? :shock:
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Sa 03.09.05 11:24 
der bereich wo sich die Icons (zB das für Thunderbird) befinden ist nicht durchsichtig.

du hast doch am linkken Rand meinen Hintergrund und wenn du das Bild genau ansiehst siehst du das der rechte Rand des Bildes eine ander farbe zwischendurch hat (der Fehler)
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Sa 03.09.05 11:29 
du meinst das weiße ? wenn du das zur laufzeit machst, kann das sein, dass das net recht funzt, im oncreate würde glaube ich schon gehen, der pixel unten links entscheidet über die transparenz farbe.
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Sa 03.09.05 11:35 
ich hab zur Sicherheit rings um das Bild einen "leeren" Streifen gelassen (den ich nur für die erkennung der Transparenten Farbe) und trotzdem malt er mir das unter XP nicht wie unter Win2K KA warum.
(genau das weiße hab ich gemeint) ich hab blos sonnst keine Idee wie ich das anders lösen kann.
Es müssen in sehr sehr kurzer Zeit 30 Icons geladen werden. und um das zu beschleunigen hab ich das Bild gemacht. weil 1 BMP ist schneller geladen als 30 Icons
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Sa 03.09.05 11:38 
dann mach die transparenz eben manuell, nimm scanline und färbe alles was weiß ist mit der farbe deines formulares 8)
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Sa 03.09.05 11:42 
mir wird wohl nix anderes übrig bleiben...

Danke für deine Hilfe

ich mach mich dann mal drüber...
Stefan-W Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: So 04.09.05 11:59 
ich hab das Problem mit einer anderen Art gelöst ich verwende da nun kein Bitmap mehr... .