PureBasic Forum
https://www.purebasic.fr/english/

[Module] Preview Module (all OS)
https://www.purebasic.fr/english/viewtopic.php?f=27&t=73469
Page 1 of 1

Author:  Thorsten1867 [ Sat Aug 24, 2019 7:47 pm ]
Post subject:  [Module] Preview Module (all OS)

For my qAES-Packer I needed a preview function and so this module was created.

  • Preview images, XML, JSON, and text
  • automatically adjust the gadget size if the content is smaller than the gadget
  • automatic window adjustment possible [#ResizeWindow]
Code:
; PreView::Gadget()             - create gadget
; PreView::FileImage()          - load a image file and preview it
; PreView::FileJSON()           - load a json file and preview it
; PreView::FileText()           - load a text file and preview it
; PreView::FileXML()            - load a xml file and preview it
; PreView::Image()              - preview image
; PreView::JSON()               - preview JSON
; PreView::Text()               - preview text string
; PreView::XML()                - previev xml 
; PreView::SetAutoResizeFlags() - [#MoveX|#MoveY|#ResizeWidth|#ResizeHeight]
; PreView::SetColor()           - similar to 'SetGadgetColor()'
; PreView::SetFont()            - similar to 'SetFont()'

Download: PreViewModule.pbi

Author:  Lord [ Sat Sep 07, 2019 9:00 am ]
Post subject:  Re: [Module] Preview Module (all OS)

Just two observations with your example code:

1. If Window is resized so that the shown picture just disappears,
the window is starting to grow and grows without any control.

2. WindowBounds() has no effekt

Author:  Kwai chang caine [ Sun Sep 08, 2019 9:10 am ]
Post subject:  Re: [Module] Preview Module (all OS)

For me the picture not disappears if i resize, there are just a flickering of the picture
The right click have no effect
W10 X64 / v5.70 X86
Thanks for sharing

Author:  Lord [ Sun Sep 08, 2019 9:57 am ]
Post subject:  Re: [Module] Preview Module (all OS)

Hi KCC!
Kwai chang caine wrote:
For me the picture not disappears if i resize, there are just a flickering of the picture
The right click have no effect
W10 X64 / v5.70 X86
Thanks for sharing
Try to resize the window small until the window is smaller as the left, top position of the picture.
Because WindowBounds() is not working here, you can resize the window to 0, 0. then the mentioned growing of the window starts.

Author:  Kwai chang caine [ Sun Sep 08, 2019 4:40 pm ]
Post subject:  Re: [Module] Preview Module (all OS)

Quote:
then the mentioned growing of the window starts.
Yes you have right, i have the same effect :D

Author:  Thorsten1867 [ Sun Sep 08, 2019 7:49 pm ]
Post subject:  Re: [Module] Preview Module (all OS)

Bugfixes

Author:  Thorsten1867 [ Mon Sep 09, 2019 2:05 pm ]
Post subject:  Re: [Module] Preview Module (all OS)

more bugfixes

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/