Page 2 of 3
Re: Comic Book / Magnifying Glass
Posted: Sat Feb 21, 2015 4:54 pm
by JHPJHP
Hi RASHAD,
That is a good idea using an image as a frame (I really like the pin-up), but you may not have seen the changes in the latest version. A single image or even multiple images won't work anymore due to the various/unlimited shapes that can be applied, not to mention the area I'm writing to is the window itself. I think either drawing the frame or my preference of using regions would work better:
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
I'd be interested to hear from others as to the quality of the magnified image, whether they experience a flicker after the latest changes.
- the 2 pixel border (can be removed) may flicker at times, but I'm only concerned with feedback about the main image
NB*: I've tested the code using a BitBlt double buffer without a noticeable difference, but I'm also not seeing a flicker.
Re: Comic Book / Magnifying Glass
Posted: Sat Feb 21, 2015 5:40 pm
by BasicallyPure
With your latest version of MagnifyingGlass I get this error message.

Re: Comic Book / Magnifying Glass
Posted: Sat Feb 21, 2015 5:46 pm
by JHPJHP
Hi BasicallyPure,
Thank you again for taking the time to test this and posting your results. I think I know why you were seeing a flicker before when I wasn't:
You may have Aero disabled or your video card doesn't support it? Can you confirm this please.
NB*: I realize this method in its current state is not viable as a magnifying tool in a production application, there are too many restrictions such as OS support and access to DWM. However I am hoping that it does provide others with some interesting code to work with and adapt to something more useful.
Re: Comic Book / Magnifying Glass
Posted: Sat Feb 21, 2015 6:30 pm
by BasicallyPure
JHPJHP wrote:You may have Aero disabled or your video card doesn't support it? Can you confirm this please.
I did have Aero disabled.
It works after I enable Aero.
No flicker, image looks good.
Re: Comic Book / Magnifying Glass
Posted: Mon Feb 23, 2015 12:47 am
by JHPJHP
Thank you BasicallyPure, I'm glad we could figure this out.
-------------------------------------------------
Updated: MagnifyingGlass.pb
- found a better way to create a border (no flicker)
- optimized the code to work with the new change
NB*: Border is now static and cannot be removed.
-------------------------------------------------
Updated: MagnifyingGlass.pb
- added the option to include a handle
-- added 1 image: handle.bmp
The update is a basic variation of what RASHAD was kind enough to post.
NB*: The Procedure: AddMagnifyHandle is currently using simple logic to account for resizing, ratio and position.
-------------------------------------------------
Updated: MagnifyingGlass.pb
- added the option to use a pattern brush
-- added 1 image: steel.bmp
NB*: Update also includes some additional improvements not worth documenting.
Re: Comic Book / Magnifying Glass
Posted: Mon Feb 23, 2015 10:04 pm
by JHPJHP
Updated: MagnifyingGlass.pb
- replaced the handle image
- added / recoded additional options
-- #MAGNIFY_SIZE = 400
-- #MAGNIFY_HANDLE = "binaries/handle.bmp"
-- #MAGNIFY_PATTERN = "binaries/steel.bmp"
-- #MAGNIFY_COLOR = $033B03
-- #MAGNIFY_OUTLINE = #Gray
-- #MAGNIFY_SHOW = #MAGNIFY_SHOW_UNDER_WINDOW
-- #MAGNIFY_RATIO = #MAGNIFY_RATIO_FIT
-- #MAGNIFY_FRAME = #MAGNIFY_FRAME_ROUND_CORNERS
NOTE:
- set #MAGNIFY_HANDLE = #NULL$ to remove the handle
- set #MAGNIFY_PATTERN = #NULL$ to use #MAGNIFY_COLOR
NB*: #MAGNIFY_OUTLINE has been disabled for: #MAGNIFY_FRAME_ROUND due to a slower refresh rate with large curves.
Re: Comic Book / Magnifying Glass
Posted: Sun Oct 11, 2015 3:34 am
by JHPJHP
Updated ComicBook.pb
- found an error that only showed when the debugger was enabled, now fixed
- improved the code slightly, nothing really noticeable
I just installed PureBasic v5.40 LTS Beta 9, and so far this was the only error I found across my Tricks 'n' Tips posts; which was a fault in the coding not the IDE.
- great job PB Team, thank you for your hard work and great product
--------------------------------------------------
If your interested in viewing images in a book-like format take a look at my other Tricks 'n' Tips post:
Embed JS Framework into PureBasic.
- TurnJS_Create.pb, TurnJS_Double.pb (
TurnJS )
Re: Magnify & Book Effects
Posted: Fri Aug 04, 2017 4:16 am
by Fangbeast
JHPJHP, wish I had seen this a few years ago.
It occurred to me that it would come in very useful for my image database and my Home Inventory pictures.
Now I just have to wait for the cold weather to stop freezing me and my brain will kick in:):)
Re: Magnify & Book & iPhone
Posted: Fri Aug 04, 2017 5:59 am
by JHPJHP
Hi Fangbeast,
Things get buried quickly, so many new posts.
The Comic Book example was based on a page-turn effect created by
Michael Vogel:
http://www.purebasic.fr/english/viewtop ... 88#p460888
Fangbeast wrote:JHPJHP, wish I had seen this a few years ago.
In light of your statement, I moved an example into this package from my
Services, Stuff & Shellhook thread; also from a few years back.
-
iPhoneIV (Image Viewer)
1. Press the iPhone button to switch between the two images.
2. Press the Spacebar to change orientation.
3. Press the Esc Key to exit the application.
NB*: Only two images have been loaded into the viewer to better demonstrate the orientation feature.
Re: Magnify & Book & iPhone
Posted: Fri Aug 04, 2017 9:54 am
by Fangbeast
I've already downloaded your code and tried it and am happy. Don't have an iphone so not likely to try that one:):)
Re: Magnify & Book & iPhone
Posted: Fri Aug 04, 2017 4:15 pm
by JHPJHP
Hi Fangbeast,
Fangbeast wrote:I've already downloaded your code and tried it and am happy.
That is good to hear... Thank you for posting back.
Concerning the iPhone example, the name is misleading; iPhone in name only and shape of the window. Otherwise it's best described as a sliding images effect (carousel animation).
1. Press the iPhone button to switch between the two images.
2. Press the Spacebar to change orientation.
3. Press the Esc Key to exit the application.
Re: Magnify & Book & iPhone
Posted: Sun Aug 20, 2017 9:16 am
by Fangbeast
Haven't been doing things for a while. Had an accident and am recovering.
Would you have an example for loading images off disk instead of a memory database?
I don't want to damage your code (until I recover, my brain isn't working) and I want to add your code to my home inventory program to view items.
Re: Magnify & Book & iPhone
Posted: Sun Aug 20, 2017 7:28 pm
by JHPJHP
Hi Fangbeast,
I've updated the ComicBook example to include a Procedure for loading images from a folder.
- #ARCHIVE_TYPE = 0 :: load images from database
- #ARCHIVE_TYPE = 1 :: load images from folder
Hope your recovery is going well.
Re: Magnify & Book & iPhone
Posted: Tue Aug 22, 2017 4:52 am
by Fangbeast
Hope your recovery is going well.
Thanks for that update. Wen I had the accident, I didn't know my left rib was hurt as well so recovery is slow but I will get there.
And when the warmer weather is here, I hope my brain kicks in as well. It was -1 again last night.
Re: Book & Viewer & Magnify
Posted: Thu Mar 25, 2021 1:44 pm
by JHPJHP
Updated (\Magnify_Glass\Magnify.pb:
- smoother image effect
- some minor code improvements
JHPJHP wrote:The script used to create the magnifying glass was taken from a comic book reader / editor I wrote awhile ago. The comic book images were resized to fit the screen. As the magnifying glass moved over the resized image, the original image was displayed within the glass area giving a magnified effect.
------------------------------------
Updated (\Comic_Book\ComicBook.pb:
- some minor code improvements