It is currently Tue Oct 22, 2019 2:05 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: [Module] Preview Module (all OS)
PostPosted: Sat Aug 24, 2019 7:47 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 913
Location: Germany
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

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] Preview Module (all OS)
PostPosted: Sat Sep 07, 2019 9:00 am 
Offline
Enthusiast
Enthusiast

Joined: Tue May 26, 2009 2:11 pm
Posts: 600
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


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] Preview Module (all OS)
PostPosted: Sun Sep 08, 2019 9:10 am 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4509
Location: Lyon - France
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


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] Preview Module (all OS)
PostPosted: Sun Sep 08, 2019 9:57 am 
Offline
Enthusiast
Enthusiast

Joined: Tue May 26, 2009 2:11 pm
Posts: 600
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


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] Preview Module (all OS)
PostPosted: Sun Sep 08, 2019 4:40 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4509
Location: Lyon - France
Quote:
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


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] Preview Module (all OS)
PostPosted: Sun Sep 08, 2019 7:49 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 913
Location: Germany
Bugfixes

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] Preview Module (all OS)
PostPosted: Mon Sep 09, 2019 2:05 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 913
Location: Germany
more bugfixes

_________________
Sorry for my English. My language is German.
(Translated with http://www.DeepL.com/Translator)

Download of PureBasic - Modules (GitHub)

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye