Book & Viewer & Magnify

Share your advanced PureBasic knowledge/code with the community.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Book & Viewer & Magnify

Post by JHPJHP »

Updated:
- all three programs received some improvements

Magnify Glass was updated to better reflect its intended use.
Does not currently include any of the calculations needed to adjust for perspective.

NB*: Book & Viewer & Magnify free executables were also updated.
Last edited by JHPJHP on Sun Mar 20, 2022 6:08 am, edited 1 time in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Book & Viewer & Magnify

Post by JHPJHP »

Updated (Magnify Glass):
- perspective/alignment algorithm completed
- right-mouse click to open another image
- press the Spacebar to toggle the main image
- replaced the handle with a better image
- restructured the code
- various other improvements

To demonstrate the accuracy of the algorithm, set #MAGNIFY_RATIO = #MAGNIFY_RATIO_FIT. As the cursor moves over the background image, the "magnified" image is drawn from memory, aligning to the background image exactly.

#MAGNIFY_RATIO_ORIGINAL will default to #MAGNIFY_RATIO_ZOOM_X2 if image width and height <= desktop width and height.
#MAGNIFY_RATIO_ZOOM_X# is limited by PureBasic's maximum image size; smaller images can support increased magnification.

NB*: Book & Viewer & Magnify free executables were also updated.

Available Options:

Code: Select all

#MAGNIFY_SHOW_UNDER_WINDOW                  = 0
#MAGNIFY_SHOW_UNDER_MOUSE                   = 1

#MAGNIFY_RATIO_ORIGINAL                     = 0
#MAGNIFY_RATIO_FIT                          = 1
#MAGNIFY_RATIO_ZOOM_X2                      = 2
#MAGNIFY_RATIO_ZOOM_X4                      = 3
#MAGNIFY_RATIO_ZOOM_X6                      = 4

#MAGNIFY_FRAME_SQUARE                       = 0
#MAGNIFY_FRAME_ROUND                        = 1
#MAGNIFY_FRAME_ROUND_CORNERS                = 2
#MAGNIFY_FRAME_USER_DEFINED                 = 3

#MAGNIFY_BORDER_NONE                        = 0
#MAGNIFY_BORDER_OUTSIDE                     = 1
#MAGNIFY_BORDER_BOTH                        = 2
Default Options:

Code: Select all

#MAGNIFY_SIZE     = 400
#MAGNIFY_HANDLE   = "styles\handle.bmp"
#MAGNIFY_PATTERN  = "styles\steel.bmp"
#MAGNIFY_COLOR    = $033B03
#MAGNIFY_OUTLINE  = $000000
#MAGNIFY_SHOW     = #MAGNIFY_SHOW_UNDER_WINDOW
#MAGNIFY_RATIO    = #MAGNIFY_RATIO_ORIGINAL
#MAGNIFY_FRAME    = #MAGNIFY_FRAME_ROUND_CORNERS
#MAGNIFY_BORDER   = #MAGNIFY_BORDER_OUTSIDE
Locked