English
Forum

Done: two Picture problems

 

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?
 
Nico Madysa
07/15/09  
 



because Windowss UI passiv (asynchon) draw.

Machs still How in Bomb 3¾ : [...] 
 
07/15/09  
 




Jörg
Sellmeyer
have You already time one Repaint in between ausprobiert?
by me comes too same The Message, that STM_SETIMAGE in the Header-File missing.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
07/15/09  
 



where I personally with so little Spielfeld mere on one hPic (or membmp) works would, or. on 2 (or more...) where the second z.B. a Klickmaske would.
 
07/16/09  
 




Nico
Madysa
@Jörg: this is well possible, I have my Messages.ph some Male extended (and forget the over ands over again. ) STM_SETIMAGE has The number $0172, STM_GETIMAGE has The number $0173. The Parameter, etc. are How with BM_SETIMAGE or. BM_GETIMAGE.
Repaint in the Loop has only one elendes Flackern bereitet, still your Tipp has me on The right Fährte gelockt. herewith works:
CompileMarkSeparation
instead of atop To krakeln I'm going directly in The Bitmap of the Statics and fordere it to the Doppelschleife on, this to Kenntnis To take.

@iF: "Asynchron, schreib the now hundertmal on The boards!
I go simply time of it from, that with your Rätselwort meant is, that DrawPic my Murmeln not immediate with commands hinmalt, separate itself first once "anstellen" must (wherever) -- and the image then sometimes überzeichnet becomes, if it finally dran is. correctly.?

so remaining only yet the seltsame behaviour the Statics spare, if of/ one the Buttons no Picbutton is. has who a idea? an Adressen-Schutzverletzung ought to this time not (again) exist.
 
Nico Madysa
07/16/09  
 



Nico Madysa, Beitrag=53263, Zeitpunkt=16.07.2009
@iF: "Asynchron, schreib the now hundertmal on The boards!




to that Topic: very, The UI has several "Pässe", everything for less Last.

The question wg. PicButton/Button have I do not kappiert.
 
07/16/09  
 




Nico
Madysa
then make still time the following:
Enkommentiere the two Lines
CompileMarkSeparation
SavePic "D:\Dat1.bmp",PLsg&
SavePic "D:\Dat2.bmp",SendMessage(hBack&,~STM_GETIMAGE,0,0)e>

and fit possible The Paths on. then kommentierst You The row Button(&loop,y%) from and activate for The under liegende row Button_2(&loop,y%). then can You the program How already before go through and you become check, that Dat1.bmp and Dat2.bmp itself discern go, though tappt im dunkeln the theoretical not should.
it would naturally yet schöner, if this Error only me aufträte.
 
Nico Madysa
07/16/09  
 



could You, the once with a 3 Zeiler demonstrating?
 
07/16/09  
 




Nico
Madysa
No, unfortunately not. Randomize, Window, end: already are three Lines lane.
but since the thing with the Murmeln clarified is, look I time, whether the thing yet moreover curtail can ...
 
Nico Madysa
07/16/09  
 




Nico
Madysa
Bitteschön, I hope, that dreiunzwanzig Lines not too much are.
CompileMarkSeparation
cls 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.
 
Nico Madysa
07/16/09  
 



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...
 
07/16/09  
 



Nachtrag: Similar: [...]  .
 
07/16/09  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.231 Views

Untitledvor 0 min.
Langer12/18/21
H.Brill01/05/19
AndreasS12/27/18
E.T.12/20/18
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie