<HTML><BODY><P class=RForeground><SPAN class=RktPn>(</SPAN><SPAN class=RktSym><A class=RktStxLink href="http://docs.racket-lang.org/reference/ivaraccess.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._send%29%29" data-pltdoc="x"><FONT color=#0000ff>send</FONT></A></SPAN><SPAN class=hspace> </SPAN><SPAN class=RktVar>a-canvas</SPAN><SPAN class=hspace> </SPAN><A name=(meth._(((lib._mred/main..rkt)._canvas~25)._get-view-start))></A><SPAN class=RktSym><A class=RktValLink href="http://docs.racket-lang.org/gui/canvas_.html#%28meth._%28%28%28lib._mred%2Fmain..rkt%29._canvas~25%29._get-view-start%29%29" data-pltdoc="x"><FONT color=#0000ff>get-view-start</FONT></A></SPAN><SPAN class=RktPn></SPAN><SPAN class=RktPn>) <BR></SPAN><BR>Then add to get-x/get-y<BR><BR>Среда, 19 июня 2013, 13:47 +09:00 от 김태윤 <kty1104@gmail.com>:<BR></P>
<BLOCKQUOTE style="BORDER-LEFT: #0857a6 1px solid; PADDING-BOTTOM: 0px; MARGIN: 10px; PADDING-LEFT: 10px; PADDING-RIGHT: 0px; PADDING-TOP: 0px" class=mailru-blockquote>
<DIV>
<DIV class="js-helper js-readmsg-msg">
<STYLE type=text/css></STYLE>
<DIV id=style_13716175150000001015 class=mr_read__body><BASE href="https://e.mail.ru/" target=_self>
<DIV id=style_13716175150000001015_BODY>how can I get image's x and y?<BR><BR>in short, the scrollbar was moved so I can see image's area whose x<BR>and y are from 90, 90 to 290, 290.<BR><BR>at this moment, I move mouse to upper-left corner of the window. and get 0,0.<BR><BR>but I want to get 90,90.<BR><BR>how can I do this?<BR><BR>thanks!<BR><BR>here my code<BR> #lang racket/gui<BR>(require racket/draw)<BR><BR>(define f<BR> (new frame%<BR> [label "hey"]<BR> [width 200]<BR> [height 200]))<BR><BR>(define img (read-bitmap "some_image.png"))<BR>(define img-w (send img get-width))<BR>(define img-h (send img get-height))<BR><BR>(define (pcb c dc)<BR> (send dc draw-bitmap img 0 0))<BR><BR>(define my_c%<BR> (class canvas%<BR> (define/override (on-event e)<BR> (printf "x: ~a y: ~a \n" (send e get-x) (send e get-y)))<BR> (super-new)))<BR><BR>(define c (new my_c%<BR> [parent f]<BR> [style (list 'hscroll 'vscroll)]<BR> [paint-callback pcb]))<BR><BR>(send c init-auto-scrollbars img-w img-h 0 0)<BR><BR>(send f show #t)<BR>____________________<BR> Racket Users list:<BR> <A href="http://lists.racket-lang.org/users" target=_blank>http://lists.racket-lang.org/users</A><BR></DIV><BASE href="https://e.mail.ru/" target=_self></DIV></DIV></DIV></BLOCKQUOTE><BR><BR>-- <BR>Roman Klochkov<BR></BODY></HTML>