Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another magnification routine (UPDATED)
#6
(04-19-2024, 05:12 PM)TerryRitchie Wrote: I corrected a bug in the code. See the original post above.

I like the program.
You could extend the main loop by manually increasing it
For example like this.

Code: (Select All)
 '+--------------------+
'| Begin main program |
'+--------------------+

Do '                                                begin main program loop
    If _KeyHit = 43 Then
        Size = Size + 0.5
        SetupMagnify 200, 200, 10, Size, 0, 0, 0, 0 
        Magnify Image 
    End If
    If _KeyHit = 45 Then
        Size = Size - 0.5
        If Size < 1 Then Size = 1
        SetupMagnify 200, 200, 10, Size, 0, 0, 0, 0 
    Magnify Image 
    End If

    _Limit 30 '                                      30 frames per second
    _PutImage , Image, 0 '                          clear the screen with image to magnify
    While _MouseInput: Wend '                        get latest mouse update
    MagnifiedImage = GetMagImage(_MouseX, _MouseY) ' get the magnified image at current mouse pointer
    _PutImage (MagX, MagY), MagnifiedImage '        display magnified image on screen
    _Display '                                      update screen with changes
Loop Until _KeyDown(27) '                            leave when ESC key pressed
_FreeImage Image '                                  remove image to magnify from RAM
_FreeImage MagnifiedImage '                          remove magnified image from RAM
System '                                            return to the operating system

'+------------------+
'| End main program |
'+------------------+
Reply


Messages In This Thread
RE: Another magnification routine (UPDATED) - by Steffan-68 - 04-19-2024, 06:22 PM



Users browsing this thread: 5 Guest(s)