Home » Developing U++ » UppHub » EditImage - editing image as String (for storing graphical information in DataBase)
EditImage - editing image as String (for storing graphical information in DataBase) [message #26875] |
Sat, 05 June 2010 02:44 |
|
I use a very simple graphical Control already in several applications. Once it became necessary to store photos in the database. The following application was necessary to quickly write to the database image of the goods. Thus was born the idea to create a simple control for storing and editing images in the database.
Maybe it's too easy to make it a separate control. But I was so comfortable. Perhaps newcomers this control seem too useful. (I'll be glad if the leaders of UPP include it as standard control in TheIde)
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
Re: EditImage - editing image as String (for storing graphical information in DataBase) [message #26876 is a reply to message #26875] |
Sat, 05 June 2010 03:25 |
|
How to use it?
Very simple.
1. Add Package "EditImage" in your project.
2. Add in the beginning "#include <EditImage/EditImage.h>"
3. In the layout designer Add Control "EditImage"
That's all.
To read an image from the database I use code like this.
SQL * Select(ANK_PHOTO).From(ANKETA).Where(ANK_ID == dlg.Qptr);
if (SQL.Fetch()) {
dlg.tabPInf.editimage.FromString(SQL[ANK_PHOTO]);
}
To write the image into the database using such a code.
SQL * SqlUpdate(ANKETA)(ANK_PHOTO,SqlBinary(dlg.tabPInf.editimage.ToString())).Where(ANK_ID == dlg.Qptr);
Another nuance! When you record images in this control all scaled to the dimension of 300x300, saving aspect (as in the database must be stored, for example, a standard-size photo).
To change this use SetStoredDimension(Size sz);
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
[Updated on: Sat, 05 June 2010 09:03] Report message to a moderator
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Wed May 08 04:37:52 CEST 2024
Total time taken to generate the page: 0.02343 seconds
|