Autor Beitrag
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mo 07.02.05 22:44 
Hallole!! :D

Ich suche eine Möglichkeit, Teile eines Formulars in meinem Prog transparent zu machen. Ähnlich wie im MS MediaPlayer.

Und bitte nicht gleich steinigen, wenns doch schon so ein Thread gab (und da bin ich mir eigentlich sicher). Ich hab wirklich sehr lange gesucht. *angsthab*

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Mo 07.02.05 22:56 
schau mal hier bei den kollegen von swissdelphicenter gibts da mehrere sachen:


mfg matze

_________________
si tacuisses, philosophus mansisses.
WeBsPaCe Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 08.02.05 00:03 
Hmm. Danke, aber ich blick's ehrlichgesagt nicht wirklich so ganz. Kann ich auch einfach die ganze Form transparent machen und die Images und Buttons und so bleiben aber??

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
Harry M.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754

Win 2000, XP
D2005
BeitragVerfasst: Di 08.02.05 00:07 
transparent wirds mit alphablend < 255
bps
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19

Win XP Pro, Debian Sarge
Delphi 2005 Prof., FPC 2.0
BeitragVerfasst: Di 08.02.05 00:11 
In der JVCL gibt es eine Komponente, die Teile des Formulars transparent machen kann. Ich glaube, die Komponente heißt TJvTransparentForm, ich bin mir aber nicht sicher.
Harry M.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754

Win 2000, XP
D2005
BeitragVerfasst: Di 08.02.05 00:14 
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Di 08.02.05 03:24 
ne möglichkeit wäre auch nen screenshot zu machen, und den auf den canvas deines formulars zu zeichnen. vielleicht halt die farben erst noch ne runde blasser machen.
WeBsPaCe Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 08.02.05 13:54 
matze.de hat folgendes geschrieben:
schau mal hier bei den kollegen von swissdelphicenter gibts da mehrere sachen:


Ich denke, so ist es am einfachsten. Ich blick's nur nicht. :lol: Ich muss einfach die komplette Form transparent machen und nur die Labels und Images bleiben sichtbar.

retnyg hat folgendes geschrieben:
ne möglichkeit wäre auch nen screenshot zu machen, und den auf den canvas deines formulars zu zeichnen. vielleicht halt die farben erst noch ne runde blasser machen.

Das hab ich mir auch überlegt. Aber verbraucht wahrscheinlich n *popo* voll Ressourcen, oder?? ;) Ich denk' für Ecken oder so würd's gehen, aber nicht, wenn ich das halbe Formular ausblenden will.

User-Xy2004 hat folgendes geschrieben:
transparent wirds mit alphablend &lt; 255

Bitte wie?? Was für ein AlphaBlend?? :? :gruebel:

User-Xy2004 hat folgendes geschrieben:
kuck hier mal:
www.delphipraxis.net...und+transparent.html
www.dsdt.info/jedi/jvcl/komponenten.php

Sorry. Ich bekomm' diese Jedi-Kompos einfach nicht installiert... :cry:

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
PattyPur
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 80

Win98, WinXP
Delphi 7
BeitragVerfasst: Di 08.02.05 15:05 
Hey Leute es geht viel Simpler!


TForm hat die Eigenschaften: TransparentColor & TransparentColorValue

Wenn du
ausblenden Delphi-Quelltext
1:
2:
Form1.TransparentColorValue:=clFuchsia;
Form1.TransparentColor:=true;


machst dann wird alles was auf dieser Form die Farbe clFuchsia hat durchsichtig.
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Di 08.02.05 15:13 
Zitat:
Das hab ich mir auch überlegt. Aber verbraucht wahrscheinlich n *popo* voll Ressourcen, oder?? ;) Ich denk' für Ecken oder so würd's gehen, aber nicht, wenn ich das halbe Formular ausblenden will.

denk ich nicht, den screenshot musst du nur machen wenn dein programm in den vordergrund kommt (WM_ACTIVATE) oder wenn die position verschoben wird. ausserdem musst du nur die pixel screenshoten, welche der position deines formulars entsprechen.
PattyPur
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 80

Win98, WinXP
Delphi 7
BeitragVerfasst: Di 08.02.05 15:48 
Um Nochmal auf meinen Vorschlag zurückzukommen:

Bau mal nen neue Anwendung


Füge einen Button und ein Shape hinzu
und dann probier mal den folgenden Code aus:

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:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
unit main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Shape1: TShape;
    procedure Button1Click(Sender: TObject);
    procedure Shape1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Shape1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Shape1MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure FormCreate(Sender: TObject);
  private
    globalx,globaly:integer;
    md:boolean;
    bstyle : TFormBorderStyle;
    formcolor: TColor;
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  form1.TransparentColor:= not form1.TransparentColor;

  if form1.TransparentColor then begin
      form1.Color:=clfuchsia;
      form1.BorderStyle:=bsnone;
  end else begin
      form1.BorderStyle:=bstyle;
      form1.Color:=formcolor;
  end;
end;

procedure TForm1.Shape1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  if md then begin
    form1.left:=form1.left+(x-globalx);
    form1.top:= form1.top+(y-globaly);
  end;

end;

procedure TForm1.Shape1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  md:=true;
  globalx:=x;
  globaly:=y;
end;

procedure TForm1.Shape1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  md:=false;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  bstyle:=form1.borderstyle;
  formcolor:=form1.Color;
end;

end.
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Di 08.02.05 15:53 
huh ? der code erzeugt ein LILA formular bei click auf button1
Harry M.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754

Win 2000, XP
D2005
BeitragVerfasst: Di 08.02.05 15:56 
alphablend kannst du im objektinpektor einstellen
ausblenden Quelltext
1:
2:
Form1.Alphablend := TRUE;
Form1.AlphablendValue := 200;

lasst die form durchsichtig werden
PattyPur
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 80

Win98, WinXP
Delphi 7
BeitragVerfasst: Di 08.02.05 16:04 
sorry entweder TForm1.FormCreate abändern:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.FormCreate(Sender: TObject);
begin
  bstyle:=form1.borderstyle;
  formcolor:=form1.Color;
  form1.TransparentColorValue:=clFuchsia;
end;



oder im Objekinspektor
TransparentColorValue auf clFuchsia setzen.
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Di 08.02.05 16:10 
aha, jetzt funktionierts.
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Di 08.02.05 16:43 
aber ist es dann nicht vollkommen durchsichtig ? geht auch halbdurchsichtigkeit, ich mache das auch immer so wenn ich zum beispiel n formular mit eigenem design machen will.
PattyPur
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 80

Win98, WinXP
Delphi 7
BeitragVerfasst: Mi 09.02.05 09:50 
es ist dann 100% an den gewünschten stellen durchsichtig

du kannst sogar an den "durchsichtigen" stellen auf die fenster im hintergrund klicken, weil dort dann einfach nix ist.
WeBsPaCe Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 09.02.05 11:13 
Sehr gut. Danke!! :D Frage beantwortet.

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.