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 » U++ Library support » RichText,QTF,RTF... » Loading Image into qtf
Re: Loading Image into qtf [message #9925 is a reply to message #9918] Sat, 09 June 2007 14:18 Go to previous messageGo to previous message
guido is currently offline  guido
Messages: 169
Registered: April 2006
Experienced Member
luzr wrote on Fri, 08 June 2007 15:58

try

dw.DrawImage(0, 0, img);

(You are drawing outside the area at 500, 500).

Or perhaps you really wanted

dw.DrawImage(0, 0, 500, 500, img)

- stretches the image to fill the area.

Anyway, that is still too ineffective, there is a nice function:

RichObject CreateImageObject(const Image& img, int cx = 0, int cy = 0);

which produces RichObject directly, without the need of ImageDraw.

For storing into DB, you can use what you suggest (which reperesents "internal" U++ image format), or you can use any StreamRasterEncoder and SaveString method.

See reference/ImageEncoders - just use SaveString to store to String instead of SaveFile (which stores to file).


Playing with the sample code, I forgot to include jpg plugin Rolling Eyes
Wonder why there is no error in that case...
So, alright. That is working now.

But no success yet, getting an Image instance back from the sqlite BLOB string.
jpg.LoadString() returns an empty Image instance.
I get a string beginning with "\377" from the query, but the decoder doesn't seem to like it.

Btw. I'm using sqlite3 C-API directly now, since the abstraction layer only got in my way while learning SQL. Absence of upp documentation in this regard didn't help either.

PS:
Found a great online resource for learning SQL:
"Akeel Din, SQL - A Practical Introduction"

Guido
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Rendering qtf into a window: horrible flicker
Next Topic: Failed to set String format in report from SQLite3
Goto Forum:
  


Current Time: Mon May 06 06:38:39 CEST 2024

Total time taken to generate the page: 0.03150 seconds