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: Sa 14.06.03 18:20 
Hi,

weiß jemand wie ich etwas, was ich direkt auf den Desktop gezeichnet habe wieder löschen kann???

Also ich hole mir mit GetDC(0) den DC vom Desktop und zeichne da fröhlich drauf rum ;)

nur, wie bekomme ich das dann alles wieder weg???
Immer nen fenster drüberschieben is nämlich doof *gg*

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 14.06.03 20:46 
Du mußt den Desktop zum Neuzeichnen veranlassen. Ich wußte sogar mal wie das geht. :roll:
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 14.06.03 21:15 
Luckie hat folgendes geschrieben:
Du mußt den Desktop zum Neuzeichnen veranlassen. Ich wußte sogar mal wie das geht. :roll:

Jep, genau... nur wie? *gg*

Hab alles versucht... hab nen WM_PAINT an den Desktop geschickt (und auchmal als Broadcast an alle Fenster), hab InvalidateRect versucht etc etc etc.. :(

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Sa 14.06.03 21:22 
Ich weiß jetzt nicht, ob der Desktop ein Handle hat (sollte er eigentlich, aber man weiß ja nie...), wenn ja, könntest du's mal mit RedrawWindow probieren.
Oder Rechtsklick->Aktualisieren :mrgreen:

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 14.06.03 21:24 
InvalidateRect().
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 14.06.03 21:35 
Hi,

RedrawWindow und InvalidateRect hatte ich schon versucht, hat auchnix gebracht... bzw, InvalidateRect schon, aber das hat dann kurz aufgeflackert.. so is das auchnet das wahre.. ;)

Au'revoir,
Aya~

PS: Ich zeichne btw etwas, was immer der Maus folgen soll = das InvalidateRect würde bei jeder Mausbewegung aufgerufen werden = flacker, flacker, flacker... ;)
Ich hab auch versucht es nur mit nem kleinen Rect (Also dem, wo mein gemale drin is) zu machen, hat aber auchnet besser geklappt :(

_________________
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: So 15.06.03 16:26 
Nur mal so als Hinweis: der Desktop hat nicht 0 als Handle..! Schau dir mal die API GetDesktopWindow an...

_________________
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: Mo 16.06.03 08:07 
Hi,
Motzi hat folgendes geschrieben:
Nur mal so als Hinweis: der Desktop hat nicht 0 als Handle..! Schau dir mal die API GetDesktopWindow an...


ich benutz GetDC(DESKTOP_HWND) und die Konstante ist als 0 definiert.. :)

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 16.06.03 08:34 
Handle <> DC!
O'rallY
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 563



BeitragVerfasst: Do 15.04.04 13:28 
Wurde das Problem jetzt eigentlich gelöst? Ich habe nämlich das gleiche Problem! InvalidateRect flackert.
Bislang habe ich es mit einem Screenshot gelöst, der kurz vorm Zeichnen gemacht wird und aus den Screenshotdaten werden die Stellen wieder hergestellt, die übermalt werden. Wenn sich nun aber irgendwas verändert hat, wenn man z.B. ein Video guckt bringts das auch nicht mehr.

_________________
.oO'rallY
Linux is like a tipi: No gates, no windows and a gnu-eating apache inside...
O'rallY
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 563



BeitragVerfasst: Do 15.04.04 13:30 
Sorry, Doppelpost. Ich bekam beim ersten senden eine Fehlermeldung, also hab ichs nochmal versucht. Anscheinend war die Fehlermeldung fehlerhaft :mrgreen:

_________________
.oO'rallY
Linux is like a tipi: No gates, no windows and a gnu-eating apache inside...


Zuletzt bearbeitet von O'rallY am Do 15.04.04 13:37, insgesamt 1-mal bearbeitet
JayK
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Do 12.10.06 12:36 
Ich suche auch bei diesem Problem nach einer Lösung und hab bis jetzt nichts gefunden. Ich möchte einen Text vom oberen an den unteren Rand des Desktops wandern lassen.

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:
procedure TPaintingThread.Execute;
var
  DCanvas: TCanvas;
  DHandle: HDC;
  x, y: Integer;
  rect: TRect;
begin
  SetName;
  DHandle := GetDC(0);
  if DHandle <> 0 then
  begin
    try
      DCanvas := TCanvas.Create;
      try
        DCanvas.Handle := DHandle;
        DCanvas.Font.Color := clGreen;
        DCanvas.Font.Size := 72;
        DCanvas.Brush.Style := bsClear;
        x := Screen.Width div 2 - DCanvas.TextWidth(MsgString) div 2;
        y := - DCanvas.TextHeight(MsgString);  // MsgSring: String; aus einer anderen Unit, globale Var
        while not Done do // Done: Boolean; aus einer anderen Unit, globale Var
        begin
          rect := DCanvas.ClipRect;
          InvalidateRect(DCanvas.Handle, @rect, true);
          DCanvas.TextOut(x, y, MsgString);
          if y < Screen.Height then
            Inc(y)
          else
            y := - DCanvas.TextHeight(MsgString);
          sleep(10);
        end;
      finally
        DCanvas.Free;
      end;
    finally
      if ReleaseDC(0, Handle) <> 1 then
        RaiseLastOSError;
    end;
  end
  else
  begin
    RaiseLastOSError;
  end;
end;

Sieht bisher schön bescheuert aus, wie grüne Marmelade o. Ä. die den Bildschirm runterläuft :mrgreen:
Der Benutzer soll währenddessen noch weiterarbeiten können, deshalb fällt die Methode vorher Bitmap speichern und Überkleistern vor dem nächsten Schritt aus.