[Module] Preview Module (all OS)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

[Module] Preview Module (all OS)

Post by Thorsten1867 »

PreView Gadget - Module (All OS / DPI / 64Bit)

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: Select all

; 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
Last edited by Thorsten1867 on Sat Nov 23, 2019 1:14 pm, edited 1 time in total.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: [Module] Preview Module (all OS)

Post by Lord »

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
Image
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: [Module] Preview Module (all OS)

Post by Kwai chang caine »

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
ImageThe happiness is a road...
Not a destination
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: [Module] Preview Module (all OS)

Post by Lord »

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.
Image
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: [Module] Preview Module (all OS)

Post by Kwai chang caine »

then the mentioned growing of the window starts.
Yes you have right, i have the same effect :D
ImageThe happiness is a road...
Not a destination
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] Preview Module (all OS)

Post by Thorsten1867 »

Bugfixes
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] Preview Module (all OS)

Post by Thorsten1867 »

more bugfixes
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Post Reply