Seite 3 von 8

Verfasst: 05.10.2007 11:23
von Scarabol
@Tafkadasom2k5
Die beiden Funktionen die du vorschlägst funktionieren leider nicht flackert trotzdem...

LockWindowUpdate_() ist schon nicht schlecht, aber dabei müsste der Fensterinhalt erhalten bleiben...

Das Flackern liegt wohl an ResizeWindow() wird in der Hilfe ja auch angesprochen, das dieses Problem auftreten kann. (siehe SmartWindowRefresh)

Ich probier mal mit API-Resize...

Gruß
Scarabol

Verfasst: 05.10.2007 11:53
von inc.

Code: Alles auswählen

Procedure TRound(Number.f) 
  If Number-Int(Number) < 0.5 
    ProcedureReturn Int(Number) 
  Else 
    ProcedureReturn Int(Number)+1 
  EndIf 
EndProcedure 
IMHO gehts so fixer?

Code: Alles auswählen

Macro Round2Nearest(___val___)
   Int(___val___# + 0.5 )
EndMacro 

Verfasst: 05.10.2007 12:24
von rolaf
Wie wär es damit:

1. Screenshot vom Fenster machen
2. Fenster schließen (Kann man auch nach 4. machen um keinen Übergang zu sehen!)
3. Randloses-Fenster gleicher Größe öffnen
4. Screenshot rein
5. bis X. Fenster verkleinern, Screenshot anpassen, Transparenz steigern , (Schleife)
Y. Fenster schließen

Verfasst: 05.10.2007 13:23
von #NULL
hatte ich probiert. war irre langsam.

Verfasst: 05.10.2007 13:45
von Tafkadasom2k5
Scarabol hat geschrieben:Ich probier mal mit API-Resize...
Versuchs mal damit
Win32API.hlp hat geschrieben:The SetWindowPos function changes the size, position, and Z order of a child, pop-up, or top-level window. Child, pop-up, and top-level windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the Z order.

BOOL SetWindowPos(

HWND hWnd, // handle of window
HWND hWndInsertAfter, // placement-order handle
int X, // horizontal position
int Y, // vertical position
int cx, // width
int cy, // height
UINT uFlags // window-positioning flags
);
Parameters

hWnd
Identifies the window.

hWndInsertAfter
Identifies the window to precede the positioned window in the Z order. This parameter must be a window handle or one of the following values:

HWND_BOTTOM Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window, the window loses its topmost status and is placed at the bottom of all other windows.
HWND_NOTOPMOST Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window.
HWND_TOP Places the window at the top of the Z order.
HWND_TOPMOST Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.
For more information about how this parameter is used, see the following Remarks section.

[X,Y,width,height schneid ich mal weg ;) ]

uFlags
SWP_DRAWFRAME
Draws a frame (defined in the window’s class description) around the window.
SWP_FRAMECHANGED
Sends a WM_NCCALCSIZE message to the window, even if the window’s size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window’s size is being changed.
SWP_HIDEWINDOW
Hides the window.
SWP_NOACTIVATE
Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).
SWP_NOCOPYBITS
Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned.
SWP_NOMOVE
Retains the current position (ignores the X and Y parameters).
SWP_NOOWNERZORDER
Does not change the owner window’s position in the Z order.
SWP_NOREDRAW
Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing.
SWP_NOREPOSITION
Same as the SWP_NOOWNERZORDER flag.
SWP_NOSENDCHANGING
Prevents the window from receiving the WM_WINDOWPOSCHANGING message.
SWP_NOSIZE
Retains the current size (ignores the cx and cy parameters).
SWP_NOZORDER
Retains the current Z order (ignores the hWndInsertAfter parameter).
SWP_SHOWWINDOW
Displays the window.

Verfasst: 05.10.2007 15:14
von AND51
@ Tafkadasom2k5:
Alles na Frage der Perpektive :roll:

@ Topic:
Ich höre was von LockWindowUpdate_()? Refreshprobleme? Ich würde es mal mit DisableWindow() probieren, da brauchste dann keinen (manuellen) Refresh. (Ich hoffe, das passte einigermaßen zum Thema)

Verfasst: 05.10.2007 15:52
von Scarabol
Hi Leute,

Problem ist der PB interne Refresh bei ResizeWindow()...

Ich werd mal den Code von Tafkadasom2k5 genauer unter die Lupe nehmen..., vielleicht hat die API diesen BUG ja nicht...

Gruß
Scarabol

Verfasst: 05.10.2007 16:35
von hardfalcon
Wenn euch das Resizen zu langsam geht, versucht es vll. mal mit nem WindowedScreen(). Dann könnt ihr das Sprite (=den Screenshot vom zu minimierenden Fenster) ja auch von der Grafikkarte hardwarebeschleunigt verkleinern lassen. Stellt sich natürlich nur die Frage, ob der WindowedScreen() selbst schnell genug geladen ist...

Verfasst: 05.10.2007 20:28
von Scarabol
So Leute hab das Flackern gelöst!!!

Code: Alles auswählen

Procedure Vista_CloseWindow(win, time)
  Protected x, y, w, h, t.f, winid, d
  winid = WindowID(win)
  x = WindowX(win)
  y = WindowY(win)
  w = WindowWidth(win)
  h = WindowHeight(win)
  t.f = 255
  s.f = 255/10
  d = Int(time/10 + 0.5)
  SetWindowLong_(winid, #GWL_EXSTYLE, GetWindowLong_(winid, #GWL_EXSTYLE) | #WS_EX_LAYERED)
  For i = 1 To 10
    SetLayeredWindowAttributes_(winid,-1,Int(t),2|1)
    Delay(d)
    SetWindowPos_(winid, 0, x+Int(w*0.01+05), y+Int(h*0.01+0.5), Int(w*0.99+0.5), Int(h*0.99+0.5), 0)
    x+Int(w*0.005+0.5)
    y+Int(h*0.005+0.5)
    w = Int(w*0.99+0.5)
    h = Int(h*0.99+0.5)
    t - s
  Next
  CloseWindow(win)
EndProcedure

OpenWindow(1, #PB_Ignore, #PB_Ignore, 400, 300, "test", #PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_MinimizeGadget)
CreateGadgetList(WindowID(1))
  ButtonGadget(1, 10, 10, 80, 20, "test")

Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
Vista_CloseWindow(1, 200)
Gruß
Scarabol

Verfasst: 05.10.2007 20:30
von X0r
Nicht flüssig.