Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

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)


  • Attachment: EditImage.zip
    (Size: 61.35KB, Downloaded 254 times)


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 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

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"
index.php?t=getfile&id=2574&private=0
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

Re: EditImage - editing image as String (for storing graphical information in DataBase) [message #26877 is a reply to message #26875] Sat, 05 June 2010 03:29 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

And in the end. Test application.

Later I'll put this control in the Bazaar.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: EditImage - editing image as String (for storing graphical information in DataBase) [message #26878 is a reply to message #26877] Sat, 05 June 2010 09:19 Go to previous messageGo to next message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
Hello Sergey,
If this is related to Databases I would put SQL or DB in package name and in name of the control and when someone search for image edit or image in database to don't get the same result. EditImage is a name too generic, IMO DBEditImage will fit better.

Andrei
Re: EditImage - editing image as String (for storing graphical information in DataBase) [message #26879 is a reply to message #26878] Sat, 05 June 2010 09:35 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

No, not only database. This, maybe, email,XML, config text..... and so on..

Main idea: EditImage - edit image as string variable.

PS.
But, yes. A little bit generic name. Razz


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}

[Updated on: Sat, 05 June 2010 09:46]

Report message to a moderator

Re: EditImage - editing image as String (for storing graphical information in DataBase) [message #26888 is a reply to message #26879] Sun, 06 June 2010 05:29 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

By the way, anyone knows how to make a crop and rotate photos?

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: EditImage - editing image as String (for storing graphical information in DataBase) [message #26889 is a reply to message #26888] Sun, 06 June 2010 11:49 Go to previous messageGo to next message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
sergeynikitin wrote on Sun, 06 June 2010 06:29

By the way, anyone knows how to make a crop and rotate photos?

ImageOp.h from Draw package have everything you need. Wink
Re: EditImage - editing image as String (for storing graphical information in DataBase) [message #26890 is a reply to message #26889] Sun, 06 June 2010 12:43 Go to previous message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Thanks!

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Previous Topic: Scatter:
Next Topic: SystemLog for Ultimate++
Goto Forum:
  


Current Time: Sat Apr 20 12:34:49 CEST 2024

Total time taken to generate the page: 0.04627 seconds