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 #11218 is a reply to message #11212] Mon, 27 August 2007 23:38 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1213
Registered: March 2006
Location: Italy
Senior Contributor
Here is a little variation of the previous code.
Now the qtf, that include the picture, needs to be saved on a file and then later opened with UWord.

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

GUI_APP_MAIN
{     FileOut save("badge.qtf");
  
      save << "[ $$0,0#00000000000000000000000000000000:Default]\n[{_}%EN-US [s0; &]\n";
   
      DrawingDraw dw(500, 500);
      Image img = StreamRaster::LoadFileAny("C:\\MyApps\\qtfimage\\ita.png");        
      dw.DrawImage(0, 0, 500, 500, img);	
      QtfRichObject pict(CreateDrawingObject(dw.GetResult(), Size(500, 500), Size(500, 500)));
   
      save << "[ {{7008:2992>1440;h1; [s0;=* &]\n";
      save << "[s0;=*+150 " << "Big Jim" << " &]\n";
      save << "[s0;= USA &] [s0;= GM 2750 &]\n";
      save << "[s0;= ] :: [s0;= " << pict.ToString() << " &][s0; ]}}&][s0; &]\n";      
  
      save.Close();
}


Unfortunately it doesn't work. The code
<< pict.ToString() <<
is wrong and I do not know how to save "pict" in some useful string format inside the document. Is it possible?... and how?
Thanks.

Luigi
 
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 Aug 04 06:29:06 CEST 2025

Total time taken to generate the page: 0.02277 seconds