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 #11253 is a reply to message #11231] Wed, 29 August 2007 00:23 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Tue, 28 August 2007 13:10


In your case, if you insist on immediate Save to disk of resulting .qtf, you can just use AsQTF(ParseQTF(text))....



It works. Thanks.
Here is the test case for other users in my same situation:

#include <CtrlLib/CtrlLib.h>
#include <plugin/png/png.h>

using namespace Upp;

GUI_APP_MAIN
{     FileOut save("badge.qtf");
  
      save << "[ $$0,0#00000000000000000000000000000000:Default]\n[{_}%EN-US [s0; &]\n";
   
      DrawingDraw dw(200, 200);
      Image img = StreamRaster::LoadFileAny("C:\\MyApps\\qtfimage\\ita.png");        
      dw.DrawImage(0, 0, 200, 200, img);	
      QtfRichObject pict(CreateDrawingObject(dw.GetResult(), Size(200, 200), Size(200, 200)));

      save << "[ {{7008:2992>1440;h1; [s0;=* &]\n";
      save << "[s0;=*+150 " << "Big Jim" << " &]\n";
      save << "[s0;= USA &] [s0;= GM 2750 &]\n";
      String text;
      text << pict;   
      save << "[s0;= ] :: [s0;= " << AsQTF(ParseQTF(text)) << " &][s0; ]}}&][s0; &]\n";      
      save.Close();
}


Quote:


Anyway, Drawing RichObjects do not have persistent storage representation, so I would also use

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

instead here.

Mirek



Unfortunately I do not understand where/how to use the previous function. Confused

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 May 06 02:14:48 CEST 2024

Total time taken to generate the page: 0.01321 seconds