ShelbySue Posted April 28, 2008 Share Posted April 28, 2008 I am attempting to simulate a image zoom by displaying the image in a window smaller than the image and offsetting the left, right to be negative. This gives the impression I am only looking at a portion of the image. I am currently panning using this code: case $msg = $but4; move image left $s = $currentx $currentx += $xoffset if $currentx > $left then $currentx = $left; if moved too far, correct if $s <> $currentx then ; if actually moved ; delete current control, then create a new one to simulate move GUIctrlDelete($pic_1) $Pic_1 = GuiCtrlCreatePic($p1, $currentX ,$currenty, 0, 0) EndIf case $msg = $but3; move image right $s = $currentx $currentx -= $xoffset if $currentx > 0 then $currentx = 0; if moved too far, correct if $s <> $currentx then ; if actually moved ; delete current control, then create a new one to simulate move GUIctrlDelete($pic_1) $Pic_1 = GuiCtrlCreatePic($p1, $currentX ,$currenty, 0, 0) EndIf Is there a smoother way to move an image around. I am using buttons. Currently the image disappears and redraws in the position desired, but that redraw is horribly inconvenient. In my application, the user clicks on a smaller version of the image to "magnify" to that point. That works fine I just can't figure out how the panning can be smoother. Joe Phillips Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted April 28, 2008 Share Posted April 28, 2008 Try moving it instead with GUICtrlSetPos() .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now