Bild immer Vordergrund

Übersicht BlitzBasic Allgemein

Neue Antwort erstellen

Iguan

Betreff: Bild immer Vordergrund

BeitragSo, Jun 18, 2006 19:04
Antworten mit Zitat
Benutzer-Profile anzeigen
A-Hoi!

Ich würde gerne ein Bild in Windows immer im Vordergrund darstellen, also wie ein Fenster, dass immer im vordergrund ist, einfach ohne Rahmen. Ich selber habe BB3D, hab mir aber gestern die BlitzSys.dll gesogen.
Kann man das damit irgendwie realisieren? (ähnlich wie Beispiel #026 des Dll-Paketes, einfach immer im Vordergrund). Oder gibt es dafür andere möglichkeiten bzw. ein bestehendes Programm?

vielen dank!


Beispiel #026:
Code: [AUSKLAPPEN]


; BLITZSYS DLL V1.05 - EXAMPLE #026
; Written by Rob Hutchinson 2002.
;
; This example shows you how to use the region commands along with the client
; area commands to cut out exactly the size of the drawable area in the window (client area).
; Apparently there is no way to change window styles once the window has been
; created, so if you wish to chop out the buttons and such, this is, probably,
; the only possible way.
;

; Include the DLL wrapper include..
Include "blitzsys.bb"

; This just checks to see if the DLL is available and correct version... (probably makes it resident too).
If DLLBlitzSysInitialise() < 105 Then RuntimeError("blitzsys.dll not found or incorrect version! You suck! :)")

Global hWnd = DLLFindBlitzRuntimeHwnd("BlitzSys Example #026")
DLLSetWindowZOrder(hWnd,HWND_NOTOPMOST)

Graphics 400,200,0,2
SetBuffer BackBuffer()

iMainRegion = DLLCreateRectRgn(DLLGetClientAreaX(hWnd),DLLGetClientAreaY(hWnd),DLLGetClientAreaWidth(hWnd),DLLGetClientAreaHeight(hWnd))
DLLSetWindowRgn(hWnd,iMainRegion,True)

txt$ = "DRAG ME AROUND... ESC TO QUIT"

Repeat
   Cls

   ; Cause a window drag when you hit the mouse button in the client area.
   If MouseHit(1) Then DLLSystemMoveWindow(hWnd)
   If MouseHit(2) Then DLLMessageBox("ARGH","Look at all that spinny crap... ")

   For a = 0 To 100
      Color Rnd(255),Rnd(255),Rnd(255)
      Line Rnd(GraphicsWidth()),Rnd(GraphicsHeight()),Rnd(GraphicsWidth()),Rnd(GraphicsHeight())
   Next
   
   Color 0,0,0
   Rect 0,0,StringWidth(txt$),StringHeight(txt$)
   Color Rnd(255),0,0
   Text 0,0,txt$
   Flip
Until KeyDown(1)

DLLDeleteObject(iMainRegion)                             ; Free the GDI region.
End

 

Dreamora

BeitragSo, Jun 18, 2006 19:22
Antworten mit Zitat
Benutzer-Profile anzeigen
Für das Fenster macht es das ja bereits.

Für die Daten im Fenster intern wird die DLL nicht benötigt. Dort ist einfach zu forderst, was als letztes gezeichnet wird. Sprich musst die Daten einfach entsprechend sortieren, dass das Element/Bild das zu vorderst sein soll zu letzt gezeichnet wird.
Ihr findet die aktuellen Projekte unter Gayasoft und könnt mich unter @gayasoft auf Twitter erreichen.

Iguan

BeitragMo, Jun 19, 2006 13:04
Antworten mit Zitat
Benutzer-Profile anzeigen
Hi!

Danke für deine Antwort, aber du hast mich falsch verstanden. das problem war, dass das fenster nicht im vordergrund blieb... dass man das, was man zuvorderst sehen soll, am schluss zeichnen muss, ist mir schon klar. Ich musste ein Parameter auf TOPMOST stellen, dann ging es.

ich habs jetzt so gemacht:

Code: [AUSKLAPPEN]

;
; BLITZSYS DLL V1.05 - EXAMPLE #026
; Written by Rob Hutchinson 2002.
;
; This example shows you how to use the region commands along with the client
; area commands to cut out exactly the size of the drawable area in the window (client area).
; Apparently there is no way to change window styles once the window has been
; created, so if you wish to chop out the buttons and such, this is, probably,
; the only possible way.
;

; Include the DLL wrapper include..
Include "blitzsys.bb"

; This just checks to see if the DLL is available and correct version... (probably makes it resident too).
If DLLBlitzSysInitialise() < 105 Then RuntimeError("blitzsys.dll not found or incorrect version! You suck! :)")

Global hWnd = DLLFindBlitzRuntimeHwnd("")
DLLSetWindowZOrder(hWnd,HWND_TOPMOST)

Graphics DLLDesktopWidth()+5,100,32,2
;Graphics3D 1280,1024,32,2
SetBuffer BackBuffer()

iMainRegion = DLLCreateRectRgn(DLLGetClientAreaX(hWnd),DLLGetClientAreaY(hWnd),DLLGetClientAreaWidth(hWnd),DLLGetClientAreaHeight(hWnd))
DLLSetWindowRgn(hWnd,iMainRegion,True)
x = DLLGetWindowX(hWnd)
y = DLLGetWindowY(hWnd)
w = DLLGetWindowWidth(hWnd)
h = DLLGetWindowHeight(hWnd)
DLLSetWindowPos(hWnd,HWND_TOPMOST,-5,-30,w,h)


Schrift = LoadImage("LOGO.bmp")
MidHandle Schrift


xx = (DLLDesktopWidth()+5)/2

Repeat
Cls
DrawImage Schrift,xx,40
Flip
Delay 100
Until KeyDown(1)

DLLDeleteObject(iMainRegion)                             ; Free the GDI region.
End




nun habe ich aber ein weiteres Problem:
wenn ich dieses Programm starte und laufen lasse, und währenddessen ein Anderes Vollbild-Programm starte und anschliessend wieder beende,
dann sieht man das LOGO nicht mehr. Das Fenster ist dann einfach schwarz.

an was liegt das? Ich hab auch schon mal versucht, das LOGO in der Hauptschlaufe immer wieder zu laden, aber das ging ebenfalls nicht!

Neue Antwort erstellen


Übersicht BlitzBasic Allgemein

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group