PlanetSquires Forums

Support Forums => General Board => Topic started by: Jean-pierre Leroy on December 11, 2009, 06:10:37 PM

Title: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Jean-pierre Leroy on December 11, 2009, 06:10:37 PM
Dear FireFly users,

I'm am happy to share with you a sample FireFly project that illustrates some aspects of the FireImage control combine with SQLitening; this project FireImageSQLiteningDemo version 1.02 illustrates how to ...

1. ... create a SQLite DataBase
2. ... save a picture in a BLOB field in the SQLite database
3. ... load dynamically a new picture from a file   into the control (%FIREIMAGE_SETIMAGENORMAL message with %FIREIMAGE_LOADFILE  )
4. ... load dynamically a new picture from a string into the control (%FIREIMAGE_SETIMAGENORMAL message with %FIREIMAGE_LOADSTRING)
5. ... adjust the image to the various available styles (%FIREIMAGE_SETFITSTYLE message)
6. ... sort a ListView (LVN_COLUMNCLICK notification)
7. ... draw a down-arrow (or up-arrow) on the columns header to indicate that information in the ListView is sorted in descending order (ascending order)
8. ... display a specific menu when the end-user click on the right mousse button over a ListView control (%WM_CONTEXTMENU & %WM_COMMAND messages)
9. ... extract the date and time a picture was taken (thanks to Jose) and store this information in the Database
10. ... resize dynamically all the controls (thanks to Paul for these new functionalities since FireFly 3.07)
11. ... display the selected picture when the user double-click a row in the ListView (%NM_DBLCLK message inside the %WM_NOTIFY message handler)
12. ... use the FF_OpenFileDialog() FireFly function
13. ... use the FF_SaveFileDialog() FireFly function
14. ... save the location and size of a FORM; function SaveLocationAndSize() inside the WM_DESTROY message handler *** NEW 07/02/2010 ***
15. ... restore the location and size of a FORM; function GetLocationAndSize() processes by the %WM_LOCATIONANDSIZE user message (WM_CUSTOM handler); thanks to Brian *** NEW 07/02/2010 ***

Notes:
   1. This project has to be compiled with Jose ROCA Includes files
   2. Most of the snippets in this project come from Paul and/or other PB users; I just try to put everything together on a sample project.
   3. This demo is not complete but could help some FF users to start with the FireImage control and a SQLite DataBase.
   4. The module Module1.inc contains some specific functions that are necessary to compile this project; usually these functions are part of my own Functions Library; to avoid any conflict I use a prefix JPL_ for these functions in this project.

Your feedback is welcome
Jean-Pierre
Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: David Kenny on December 11, 2009, 07:31:25 PM
Very nice job Jean-Pierre!

David
Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Paul Squires on December 12, 2009, 10:26:51 AM
Very cool Jean-Pierre! Great job. Thanks for sharing!


(Oh, you may want to distribute the sqlitening.inc file with your project as well).

Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Jean-pierre Leroy on December 13, 2009, 01:11:37 PM
David, Paul; thank you for your messages; I hope this project could help some FF users to start using a SQLitening DataBase with BLOB fields that contain pictures (jpg files).

Paul; I followed your advice; I have just uploaded a new version that contains the SQLitening.inc as a module of the project.

Paul with the sample database included in this project 3 pictures out of 4 can be displayed correctly with the option %FIREIMAGE_LOADSTRING; only the picture "Collines.jpg" cannot be displayed; so my question is why it works with some pictures and not with others? any chance to have a fix in the upcoming 3.05 version for this odd issue?

Regarding this issue with the picture "Collines.jpg" I would like to know if other users have the same issue as me; please can you report in this thread if you have the same behavior with your PC; thank you.

Jean-Pierre
Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Andrew Lindsay on December 13, 2009, 10:47:54 PM
Jean-Pierre,

I can get all the pictures to load with the LOADFILE button, but when I press the LOADSTRING button, at best I get a 'tear' of the picture (a partial flash of the file on screen) then a blank canvas.

Best regards

Andrew
Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Jean-pierre Leroy on December 15, 2009, 06:31:20 PM
Hi Andrew, Thanks for reporting your tests on this thread; which system are you using ?

Jean-Pierre
Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Andrew Lindsay on December 16, 2009, 07:15:23 PM
Jean-Pierre,

I am using Windows 7 on an HP 8510P notebook, compiled with 3.04.

Regards

Andrew
Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Marc van Cauwenberghe on January 04, 2010, 09:24:27 AM
No problems here,

Great stuff, thanks.

Marc
Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Rolf Brandt on January 04, 2010, 11:09:42 AM
Hello Jean-Pierre,

Quoteonly the picture "Collines.jpg" cannot be displayed with the option %FIREIMAGE_LOADSTRING; I would happy if other users can tell me if they have the same behavior on their PCs.

I have exactly the same behavior on my XP Pro SP3 machine. Also some of my own Jpegs won't show with LoadString.

Rolf
Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Pat Dooley on January 05, 2010, 04:19:27 PM
Yes, "Collines" would not display.
I used SQLiteExpertPro to view and then export the jpg's from the db3. Then I used IRFanView to examine the Image  Information for each file. The only difference was that "Collines" had a DPI setting of 300. All the rest had a DPI setting of 96. Usng IRFanView, I changed the DPI setting to 96 and saved it under a different name. It loaded and displayed fine in the Fire Image Demo.
I don't know why DPI would make such a difference.
Pat
Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Jean-pierre Leroy on January 17, 2010, 03:43:06 AM
Pat, thank you for reporting what you have found with the DPI value; in the meantime Paul changed the FireImage control due to other issues with Windows 7; more information on this thread http://www.planetsquires.com/protect/forum/index.php?topic=2295.msg17932#msg17932

Now with the fixed version of the FireImage control, all the pictures are displayed correctly with either options i.e. LOADFILE (%FIREIMAGE_LOADFILE) and LOADSTRING (%FIREIMAGE_LOADSTRING).

Paul, I have nevertheless a small issue with the new version of the FireImage control; at least on my PC the temporary disk files are not deleted when I quit my application; see the screenshot.

Jean-Pierre.
Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Paul Squires on January 17, 2010, 10:37:32 AM
Thanks Jean-Pierre, I will double check the logic that deletes the temp files.
Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Jean-pierre Leroy on May 09, 2010, 08:15:56 AM
Dear FireFly users,

I've just updated the FireImageSQLiteningDemo (FF Project available at the beginning of the thread) to show how to :

9. ... extract the date and time a picture was taken (thanks to Jose) and store this information in the Database
10. ... resize dynamically all the controls (thanks to Paul for these new functionalities since FireFly 3.07)
11. ... display the selected picture when the user double-click a row in the ListView (%NM_DBLCLK message inside the %WM_NOTIFY message handler)
12. ... use the FF_OpenFileDialog() FireFly function
13. ... use the FF_SaveFileDialog() FireFly function

Any question, do not hesitate to ask.

Your feedback is welcome.
Jean-Pierre
Title: Re: FireImageSQLiteningDemo - FireImage control with SQLitening DataBase
Post by: Jean-pierre Leroy on July 02, 2010, 07:40:39 AM
Dear FireFly users,

I've just updated the FireImageSQLiteningDemo to version 1.02 (FF Project available at the beginning of the thread) to show how to :

14. ... save the location and size of a FORM; function SaveLocationAndSize() inside the WM_DESTROY message handler
15. ... restore the location and size of a FORM; function GetLocationAndSize() processes by the %WM_LOCATIONANDSIZE user message (WM_CUSTOM handler); thanks to Brian

Any question, do not hesitate to ask.

Your feedback is welcome.
Jean-Pierre