Autor Beitrag
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Mi 26.03.03 02:33 
Hi,

ich hab hier nen problem mit MDI Forms und Bildern... :)
und zwar...

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.Button1Click(Sender: TObject);
begin
  h:=Handle;
  i:=CreateWindowEx(0,'STATIC','MyImage',SS_BITMAP or WS_VISIBLE or WS_CHILD,30,30,924,652,h,0,h,nil);
  b:=LoadBitmap(hInstance,'BACKGROUND');
  SendMessage(i,STM_SETIMAGE,IMAGE_BITMAP,b);
  dc:=GetDC(i);
  Timer.Enabled:=True;
end;


Damit erstelle ich auf dem Form ein Image... (Das Form ist fsMDIForm)

im Timer (Intervall = 1) wird dashier gemacht:
ausblenden Quelltext
1:
2:
3:
4:
procedure TForm1.TimerTimer(Sender: TObject);
begin
  SendMessage(i,WM_PAINT,dc,0);
end;


So... an und fürsich klappt das alles wunderbar, nur im zusammenhang mit MDI Forms net... wenn ich jetzt in Form1 ein MDI Child anzeigen lasse, wird das von dem Bild überdeckt... :(

weiß jemand was ich da dagegen machen kann???

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
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 26.03.03 08:57 
Also erstens kommt mir die Methode mit dem Timer doch etwas unprofessionell vor... hät ich nicht von dir erwartet! :wink:
Ich würde mal probiern was passiert wenn du auf die WM_EREASEBKGND Message reagierst und dann neu zeichnest.

Zu dem eigentlichen Problem.. kannst du mal dein OnPaint-Ereignis bzw den WM_PAINT-Message-Handler (je nachdem wie dus gemacht hast) posten..?

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

NT, 2000
D6
BeitragVerfasst: Mi 26.03.03 10:13 
Titel: Timer, Hifle
Hi Aya,

Timer sind eine tolle Sache um Problem schnell zu lösen, die man besser anders lösen sollte. Da begibt man sich dann auf eine Schiene, von der man nicht mehr loskommt.

Ich restauriere gerade alten Code, dessen Entwickler auch auf Timer abgefahren ist. Davon gibts mehrere, die je nach Durchlaufnummer verschiedene Dinge erledigen und sich dabei noch gegenseitig an- und ausschalten.

Da kann ich nur Motzi beipflichten und sagen: Bitte tuts nicht

Manfred
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Mi 26.03.03 17:24 
Hi,

*grinst verlegen* Ja der Timer... :)
Das ich den genommen habe liegt daran das ich im grunde genommen das Bild in einem anderen Programm anzeigen will ;)

Ich finde den grauen Hintergrund von PSP so trist das ich da nne Bild hinmachen will... klappt auch, nur halt die MDI Fenster werden von dem Bild überdeckt :(

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
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 26.03.03 22:48 
Wegen dem Timer.. wenn dus ganze perfekt machen willst injezier eine Dll und subclass das Fenster! :wink:

Zu dem Problem mit den MDIs.. wie ermittelst du denn das DC-Handle?

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Mi 26.03.03 22:51 
Motzi hat folgendes geschrieben:
Zu dem Problem mit den MDIs.. wie ermittelst du denn das DC-Handle?


Wieso DC Handle? :roll:

_________________
Aya
I aim for my endless dreams and I know they will come true!
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Mi 26.03.03 23:56 
huhu :)

ok, hab es jetzt mal versucht direkt auf den Canvas vom Form zu zeichnen...

mit BitBlt, klappt aber auchnet... auch dann werden die MDI Fenster von dem Bild überdeckt :(

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Do 27.03.03 00:01 
huhu nochma :)

hab nu rausgefunden, das alles überdeckt wird, was von TGraphicControl abgeleitet wird...

Alles was von TWinControl abgeleitet wird, wird korrekt angezeigt :(

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Do 27.03.03 10:08 
Aya hat folgendes geschrieben:
Wieso DC Handle? :roll:

Na das Handle auf den DeviceContext auf den du zeichnest...

Aya hat folgendes geschrieben:
hab nu rausgefunden, das alles überdeckt wird, was von TGraphicControl abgeleitet wird...

Alles was von TWinControl abgeleitet wird, wird korrekt angezeigt

Wie jetzt? Zeichnest du jetzt auf deine Form oder auf die von PSP?!? *verwirrtbin* :?

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Do 27.03.03 10:46 
auf das Form von PSP ;)

Den DC hab ich da mit GetDC() bekommen.. und das Handle halt mit FindWindow :)

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Do 27.03.03 12:55 
Aya hat folgendes geschrieben:
auf das Form von PSP ;)

Und PSP hat TWinControl-Objekte auf der Form..? :shock:

Zitat:
Den DC hab ich da mit GetDC() bekommen.. und das Handle halt mit FindWindow :)

OK, soweit klar... post am besten mal eine URL zu einem Screenshot oder häng einen an, weil so kann ich mir momentan nicht wirklich viel vorstellen. Sobald ich dann zuhaus bin kann ich dann auch ein paar Tests machn (hät auch schon ein paar Ideen für Lösungsansätze..) :)

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Do 27.03.03 13:16 
Hi,

na ja.. auf nem Screenshot würdest nix sehen ausser meinem Bild =)

Das Problem is einfach das die MDIForms wohl von TGraphicControl abgeleitet sind, und halt wie ja oben gesagt alle von TGraphicControl abgeleiteten Objekte von dem Bild überdeckt werden :(

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Do 27.03.03 14:04 
Also MDIFormen stellen "waschechte Fenster" dar! ;) In Delphi-Objekt-Sprache ausgedrück :wink: heißt das sie stammen von TWinControl ab, da sie ein eigenes Fenster-Handle haben!

Zeig bitte trotzdem mal nen Screenshot... ich will nur sehen, was jetzt wirklich übermalt wurde und was nicht. Am besten wären 2 Stück: einer mit dem Originalfenster, und einer bei dem du ins Fenster "hineingepfuscht" hast :wink:

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Do 27.03.03 14:11 
huhu,

du glaubst mir nich, mh? *g*
Wie ich sage, von den MDI Forms in PSP ist rein garnichtsmehr zu sehen, die sind komplett (titelleiste, inhalt.. ALLES :) ) verdeckt ;)

hast du kein PSP?? Teste es doch da einfach mal :)

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Do 27.03.03 14:18 
Aya hat folgendes geschrieben:
huhu,

du glaubst mir nich, mh? *g*
Wie ich sage, von den MDI Forms in PSP ist rein garnichtsmehr zu sehen, die sind komplett (titelleiste, inhalt.. ALLES :) ) verdeckt ;)

Doch, ich glaub dir schon.. aber ein Screenshot würde meine Fantasien wie das ausschaun könnte etwas beflügeln! :wink:
Wenn du keinen Screenshot posten willst, dann vielleicht den genauen Code wie du auf dem Fenster herumpinselst...

Zitat:
hast du kein PSP?? Teste es doch da einfach mal :)

Das kommt ganz darauf an was du mit PSP meinst.. ;) Photoshop oder PaintShopPro?

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!