English
Source / code snippets

Image Bitmap dialog Scrolling Simples

 

CompileMarkSeparation

86 kB
Hochgeladen:09/25/07
Downloadcounter365
Download
741 kB
Hochgeladen:09/25/07
Downloadcounter280
Download
2 kB
Hochgeladen:09/25/07
Downloadcounter286
Download
 
09/25/07  
 




Frank
Abbing
Have some things correct, How: Flackern eliminating, automatic Bildrestaurierung and Echtzeitscrollen.
CompileMarkSeparation
 {$cleq}
Const appTitle=PicScrollDlg
Const scrollBarsWidth=20
long hPic=create(hPic,-1,background.bmp)     Bildnamen anpassen
long hPic.szX=bmpx,hPic.szY=bmpy
windowstyle 2 | 8 | 16 | 512
long hDlg=createwindow(hwnd,appTitle,100,100,540,380)
long hDlg.hScrollY=create(vScroll,hDlg,,width(hDlg)-scrollBarsWidth,0,scrollBarsWidth,height(hDlg)-scrollBarsWidth)
long hDlg.hScrollX=create(hScroll,hDlg,,0,height(hDlg)-scrollBarsWidth,width(hDlg)-scrollBarsWidth,scrollBarsWidth)
long hBlindStatic=create(text,hDlg,,width(hDlg)-scrollBarsWidth,height(hDlg)-scrollBarsWidth,scrollBarsWidth,scrollBarsWidth)
SubClass hDlg.hScrollX, 1
SubClass hDlg.hScrollY, 1
SubClass hDlg, 1
usermessages wm_close

While 1

    hPic.Paint(hPic,hDlg,hDlg.hScrollX,hDlg.hScrollY,hPic.szX,hPic.szY)
    invalidaterect(hBlindStatic,0,0)
    updatewindow(hBlindStatic)
    waitinput
    case umessage==wm_close:break

EndWhile

deleteobject hpic
destroywindow(hDlg)
end

Proc hPic.Paint

    Parameters hPic2&,hDlg&,hScrlX&,hScrlY&,picSzX&,picSzY&
    long x=0-getScrollPos(hScrlX&)/100*(picSzX&-width(hDlg&)+scrollBarsWidth)
    long y=0-getScrollPos(hScrlY&)/100*(picSzY&-height(hDlg&)+scrollBarsWidth)
    startpaint hDlg&
    CopyPic hPic2&, 0,0 - (width(hDlg&)-scrollBarsWidth)-x,(height(hDlg&)-scrollBarsWidth)-y > x,y; 0
    endpaint
    invalidaterect(hScrlX&,0,0)
    updatewindow(hScrlX&)
    invalidaterect(hScrly&,0,0)
    updatewindow(hScrly&)

EndProc

SubClassProc

    If ((%sMessage=SBM_GETRANGE) or (%sMessage=WM_PAINT))

        hPic.Paint(hPic,hDlg,hDlg.hScrollX,hDlg.hScrollY,hPic.szX,hPic.szY)
        invalidaterect(hBlindStatic,0,0)
        updatewindow(hBlindStatic)

    EndIf

ENDPROC

 
12/10/08  
 




RGH
here the XPSE-code translated to XProfan:
CompileMarkSeparation
 $H Windows.ph
 $H Messages.ph
def $appTitle "PicScrollDlg"
def &scrollBarsWidth 20
var hPic& = create("hPic", -1, "hintergrund.bmp") Bildnamen anpassen
var hPic.szX& = %bmpx
var hPic.szY& = %bmpy
windowstyle 2 | 8 | 16 | 512
var hDlg& = create("window", %hwnd, $appTitle, 100, 100, 540, 380)
var hDlg.hScrollY& =
create("vScroll", hDlg&, "", width(hDlg&) - &scrollBarsWidth, 0,
&scrollBarsWidth, height(hDlg&) - &scrollBarsWidth)
var hDlg.hScrollX& =
create("hScroll", hDlg&, "", 0, height(hDlg&) - &scrollBarsWidth,
width(hDlg&) - &scrollBarsWidth, &scrollBarsWidth)
var hBlindStatic& =
create("text", hDlg&, "", width(hDlg&) - &scrollBarsWidth, height(hDlg&) - &scrollBarsWidth,
&scrollBarsWidth, &scrollBarsWidth)
SubClass hDlg.hScrollX&, 1
SubClass hDlg.hScrollY&, 1
SubClass hDlg&, 1
usermessages ~wm_close

While 1

    hPic.Paint(hPic&, hDlg&, hDlg.hScrollX&, hDlg.hScrollY&, hPic.szX&, hPic.szY&)
    ~invalidaterect(hBlindStatic&, 0, 0)
    ~updatewindow(hBlindStatic&)
    waitinput
    case %umessage = ~wm_close : break

EndWhile

deleteobject hpic&
destroywindow(hDlg&)
end

Proc hPic.Paint

    Parameters hPic2&,hDlg&,hScrlX&,hScrlY&,picSzX&,picSzY&
    var x& = 0 - getScrollPos(hScrlX&) / 100 * (picSzX& - width(hDlg&) + &scrollBarsWidth)
    var y& = 0 - getScrollPos(hScrlY&) / 100 * (picSzY& - height(hDlg&) + &scrollBarsWidth)
    startpaint hDlg&
    CopyPic hPic2&, 0,0 - (width(hDlg&) - &scrollBarsWidth - x&),
    (height(hDlg&) - &scrollBarsWidth - y&) > x&, y&; 0
    endpaint
    ~invalidaterect(hScrlX&, 0, 0)
    ~updatewindow(hScrlX&)
    ~invalidaterect(hScrly&, 0, 0)
    ~updatewindow(hScrly&)

EndProc

SubClassProc

    If ((%sMessage = ~SBM_GETRANGE) or (%sMessage = ~WM_PAINT))

        hPic.Paint(hPic&, hDlg&, hDlg.hScrollX&, hDlg.hScrollY&, hPic.szX&, hPic.szY&)
        ~invalidaterect(hBlindStatic&, 0, 0)
        ~updatewindow(hBlindStatic&)

    EndIf

./../../function-references/XProfan/endproc/'>ENDPROC


Greeting
Roland

@iF: here's it really completely unverständlich, Why einerseits left next to the Posting a large vain Area is and for in the countermove the Listing constantly to right To scroll is, for a slightly what To erfassen. of my unmaßgeblichen opinion to ought to the Einrücken the Postings zugunsten better Lesbarkeit ersatzlos gestrichen go!
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
12/11/08  
 




RGH
and the whole explicit kürzer:
CompileMarkSeparation
 $H Messages.ph
def $appTitle "PicScrollDlg"
def &scrollBarsWidth 16
var hPic& = create("hPic", -1, "hintergrund.bmp") Bildnamen anpassen
var hPic.szX& = %bmpx
var hPic.szY& = %bmpy
windowstyle 2 | 8 | 16 | 512
var hDlg& = create("window", 0, $appTitle, 100, 100, 540, 380)
var hDlg.hScrollY& =
create("vScroll", hDlg&, "", width(hDlg&) - &scrollBarsWidth, 0,
&scrollBarsWidth, height(hDlg&) - &scrollBarsWidth)
var hDlg.hScrollX& =
create("hScroll", hDlg&, "", 0, height(hDlg&) - &scrollBarsWidth,
width(hDlg&) - &scrollBarsWidth, &scrollBarsWidth)
SubClass hDlg.hScrollX&, 1
SubClass hDlg.hScrollY&, 1
hPic.Paint(hPic&, hDlg&, hDlg.hScrollX&, hDlg.hScrollY&, hPic.szX&, hPic.szY&)

While 1

    waitinput
    case %key = 2 : break

EndWhile

deleteobject hpic&
destroywindow(hDlg&)
end

Proc hPic.Paint

    Parameters hPic2&,hDlg&,hScrlX&,hScrlY&,picSzX&,picSzY&
    var x& = 0 - getScrollPos(hScrlX&) / 100 * (picSzX& - width(hDlg&) + &scrollBarsWidth)
    var y& = 0 - getScrollPos(hScrlY&) / 100 * (picSzY& - height(hDlg&) + &scrollBarsWidth)
    startpaint hDlg&
    CopyPic hPic2&, 0,0 - (width(hDlg&) - &scrollBarsWidth - x&),
    (height(hDlg&) - &scrollBarsWidth - y&) > x&, y&; 0
    endpaint

EndProc

SubClassProc

    If ((%sMessage = ~SBM_GETRANGE) or (%sMessage = ~WM_PAINT))

        hPic.Paint(hPic&, hDlg&, hDlg.hScrollX&, hDlg.hScrollY&, hPic.szX&, hPic.szY&)

    EndIf

ENDPROC

 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
12/11/08  
 




Frank
Abbing

only to information: From ":=" for Wertzuweisungen within XProfan be I abgekommen, that simple Gleichheitszeichen for Zuweisungen and doppeltes Gleichheitszeichen for compare use I today only yet.


Have just your code übernommen and then extended. I use only one Gleichzeichen for compare and Zuweisungen. your works is ineffizient.
 
12/11/08  
 



RGH
@iF: here's it really completely unverständlich, Why einerseits left next to the Posting a large vain Area is and for in the countermove the Listing constantly to right To scroll is, for a slightly what To erfassen.


code "Separieren" for code-Vollbild, More can I _im Moment_ not afford.
 
12/15/08  
 




Jörg
Sellmeyer
Why not simply any Posts beautiful left reported among themselves? this left/right power The Page very restless. I komm me to How at tennis.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
12/15/08  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

6.640 Views

Untitledvor 0 min.
Jörg Sellmeyer06/07/20
H.Brill05/04/19
Rainer Hoefs05/03/19
Christof Neuß07/11/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