Forum | | | | - Page 1 - |
| Nico Madysa | Hello together!
I have my Program time the minimum minimizes, with the it still two strange Erscheinungen gives: CompileMarkSeparation $H Messages.ph
proc Zeige_Kugeln
declare ly% , gueltig%
alle Buttons durchgehen
whileloop 0,9
ly% = &loop
whileloop 0,9
if xor(not(&loop mod 9),not(ly% mod 9)) or (not(&loop) and (ly% = 9))
Rand deaktivieren
EnableWindow But&[&loop,ly%],0
elseif (&loop mod 9) and (ly% mod 9)
Mittelfeld aufdecken
ShowWindow(But&[&loop,ly%],0)
endif
Die Kullern anzeigen
if between(&loop,1,8,ly%,1,8)
SetTimer 0 : waitinput : KillTimer
if feld%[&loop - 1,ly% - 1]
DrawPic PTrue&,&loop * 48,ly% * 48;-1
endif
endif
EndWhile
EndWhile
Das gemalte ans Hintergrundbild klatschen
PLsg& = Create("hPic",0,"&SCRBMP")
SendMessage(hBack&,~STM_SETIMAGE,0,PLsg&)
SavePic "D:\Dat1.bmp",PLsg&
SavePic "D:\Dat2.bmp",SendMessage(hBack&,~STM_GETIMAGE,0,0)
Zu guter Letzt den deaktivierten Rand wegmachen
whileloop 0,9
ly% = &loop
whileloop 0,9
case xor(not(&loop mod 9),not(ly% mod 9)) : ShowWindow(But&[&loop,ly%],0)
EndWhile
EndWhile
endproc
proc Button
parameters px% , py%
Rand: Bilder, Mitte: normal
ifnot (px% mod 9) and (py% mod 9)
But&[px%,py%] = Create("PicButton",%hWnd,PTrue&,px% * 48,py% * 48,48,48)
else
But&[px%,py%] = Create("Button",%hWnd,"",px% * 48,py% * 48,48,48)
endif
endproc
proc Button_2
parameters px% , py%
nur ein Button am Rande ist kein Bild
if (px% = 0) and (py% = 9)
But&[px%,py%] = Create("Button",%hWnd,"",px% * 48,py% * 48,48,48)
elseif not((px% mod 9) and (py% mod 9))
But&[px%,py%] = Create("PicButton",%hWnd,PTrue&,px% * 48,py% * 48,48,48)
else
But&[px%,py%] = Create("Button",%hWnd,"",px% * 48,py% * 48,48,48)
endif
endproc
proc Bereite_Bilder
Hintergrundbild
PBack& = Create("hNewPic",481,481,$FFFFFF)
StartPaint PBack&
UsePen 0,1,0
whileloop 2,8
Rectangle (48*&loop-1),0 - (48*&loop+1),480
EndWhile
whileloop 2,8
Rectangle 0,(48*&loop-1) - 480,(48*&loop+1)
EndWhile
EndPaint
Bild für die Kullern
PTrue& = Create("hNewPic",48,48,$FFFFFF)
StartPaint PTrue&
UsePen 0,1,0
UseBrush 1,0
Ellipse 2,2,45,45
EndPaint
endproc
proc BuildUp
declare y%
WindowStyle 26
Window 100,50 - 500,520
Hintergrund
hBack& = Create("Bitmap",%hWnd,PBack&,0,0)
alle Buttons
whileloop 0,9
y% = &loop
whileloop 0,9
Button(&loop,y%)
Button_2(&loop,y%)
EndWhile
EndWhile
endproc
proc Platziere_Kugeln
declare rx% , ry%
clear feld%[]
whileloop 4
repeat
rx% = Rnd(8)
ry% = Rnd(8)
until not(feld%[rx%,ry%])
feld%[rx%,ry%] = 1
EndWhile
endproc
declare But&[9,9], feld%[7,7]
declare hBack&,PBack&,PLsg& , PTrue&
Randomize
Bereite_Bilder
BuildUp
Platziere_Kugeln
var e% = 0
whilenot e%
waitinput
if Clicked(But&[9,9])
e% = 1
elseif Clicked(But&[0,9])
Zeige_Kugeln
endif
wend
DeleteObject PBack&
DeleteObject PLsg&
DeleteObject PTrue&
end
it'll the following made: To Beginn go in the Matrix area% four random chosen values on 1 staid (my Murmeln, see below ). the Staticcontrol, the in the background lying, becomes of Buttons überdeckt. clicking one now on the Button under left (with the lever But&[0,9]), so go The Randbuttons deaktiviert and the mittleren cache. so becomes the essenzielle part the Hintergrundbitmap visible. hereon go four trickle from area% hingemalt. the whole Window becomes in a Bitmap Safe and the Hintergrundbitmap transfer, the status quo becomes means fixes. to that Schluss go The deaktivierten Randbuttons invisible made, only The corners and the Wallpapers verbleiben. (The downstairs rights Button exits the program.)
trouble 1: in the Compilations are missing from the four Murmeln mostly some. in the Interpreter go always any four displayed. If the row SetTimer 1 : waitinput : KillTimer (Dulcoif) activate becomes, go in Compilations any trickle displayed. Sleep zeitigt no effect. finds it in separated creep instead of, that The Buttons removes and the Kreise painted go, so go likewise any four Kreise displayed. still Why functions The upper Variante not? One Zeitproblem can not his, there Sleep nothing bring.
trouble 2: one supplant whom appeal Button(&loop,y%) through Button_2(&loop,y%). therefore is a einziger the Randbuttons bildlos, separate one standard-Button. this has whom unerklärlichen effect, that The Hintergrundbitmap only yet a black expanse and the Button exists. Wers not believes, can the Images absichern let. the Fensterfoto &SCRBMP is yet tidy, still The Bitmap of the Static-Controls is More as fraglich. still Why? |
| | | | |
| | | | | - Page 1 - |
| Nico Madysa | Bitteschön, I hope, that dreiunzwanzig Lines not too much are. CompileMarkSeparationcls 16777215
P& ist das Bild des Buttons
var P& = Create("hNewPic",48,48,$22DD22)
Die Buttons sind h& und g&. Jeder kann ein Text- oder ein Bildbutton sein.
var h& = Create("Button",%hWnd,"Text",0,0,48,48)
var h& = Create("PicButton",%hWnd,p&,0,0,48,48)
var g& = Create("PicButton",%hWnd,p&,48,0,48,48)
var g& = Create("Button",%hWnd,"Text",48,0,48,48)
Der Fensterinhalt wird fotografiert und nach unten versetzt angezeigt.
var Q& = Create("hPic",0,"&SCRBMP")
cls 0 Damit man Bild und Bildschirm unterscheiden kann.
Create("Bitmap",%hWnd,Q&,0,48)
Rest
whilenot IsKey(27)
waitinput
wend
DeleteObject P&
DeleteObject Q&
end
The Error exit on, once too only one einziger normal Button on-screen visible is. are two Picbuttons there, so runs everything normal. If the Textbutton before cache becomes, functions ditto everything wonderful. |
| | | | |
| | | Achso now understand I your trouble, Yes this is "normal".
windows knows not which Pixel behind* one Control lying, I had time with Frank above debattiert but find The Thread not any more.
in the Fazit is scrbmp (naturally) "unzuverlässig". ^^
Ziehe time calc.exe over your hWnd and copy the hWnd ex, calc is with with!
DCs are nunmal no Pixelspeicher.
Perhaps. is this with "AERO" now (something) differently... |
| | | | |
| | | Nachtrag: Similar: [...] . |
| | | | |
| | | | - Page 2 - |
| | Nico Madysa | so ne Doofen Contexte! well, then must I hereon in future pay attention. thanks for speedy Beantwortung of my both ask. |
| | | | |
| | | The are not thick, The make the already "richtig". |
| | | | |
| | Nico Madysa | I see already, on it fail even The berühmte pressure-s-Abf-Button ... still say time, it speaks still nothing against a Spieleanwendung, which of course not whom background rückt (HWND_TOPMOST), itself but minimize can, gelle? |
| | | | |
| | | comic framed have You, the not at all "nötig". Nimm simply Bitmaps or. Picture-Statics and send this new hPic-Handles as they something other show should. the Repaint is its trouble. or You draw same The whole surface in a hPic and malst the hPic aufs hWnd.
i'd gladly The task understand, what very reserves because go? |
| | | | |
| | Nico Madysa | How You sure already guess have, one game. The problem is, I from Found the Designs kurzzeitig on the deaktivierten Button self herummalen must. yet was trouble, that the part the Bildes then the next Repaint naturally lane is, therefore The idea, button with images on one Hintergrundstatic To fix. still there power Yes even now &SCRBMP Ärger. |
| | | | |
| | | >> How You sure already guess have, one game.
au Yes, be thereby!
and everything only so something clickable is?
Welchem game kommts on the nähesten? |
| | | | |
| | Nico Madysa | These mixture from Minesweeper and Schiffe Versenken, with the You me already with the Updatefunktion helped have. : [...] I habs yet only not yet angekündigt, because it into competition should, once The worst Kinderkrankheiten auskuriert are. in the yet hochgeladenen Version there too not yet the Hintergrundstatic, by which the Gezeichnete disappears, once what above slide. |
| | | | |
| | | understand, then would I absolutely recommend simply on the hWnd To stay circa there z.B. one hPic to drawing which the complete game contains.
In one 2. hPic draw You only The klickbaren reaches, eachone area simply another colour. with one GetPixel this hPic get one fix out, on whom area (Objekt) clicked watts and even Karenz if erwünscht.
Nachtrag: Tolles game! |
| | | | |
| | Nico Madysa | [...] i don't know, whether I correctly. understand, what you mean. the game exists Yes gewissermaßen from two Hälften. in the first only Buttons on the Spielfeld and one game hold. first in the second Half, in the Solution, come then almost any Buttons lane and the image becomes drawn. The Randbuttons are really only dageblieben, because otherwise The abgefeuerten Laserstrahlen from the nothing auftauchten. it sees so simply toller from. |
| | | | |
|
AnswerThemeninformationenthis Topic has 3 subscriber: |