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 |
|
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.
Luigi
|
|
|
|
|
Loading Image into qtf
By: guido on Fri, 08 June 2007 12:18
|
|
|
Re: Loading Image into qtf
By: mirek on Fri, 08 June 2007 15:58
|
|
|
Re: Loading Image into qtf
By: guido on Sat, 09 June 2007 14:18
|
|
|
Re: Loading Image into qtf
By: mirek on Sat, 09 June 2007 18:54
|
|
|
Re: Loading Image into qtf
By: forlano on Mon, 27 August 2007 19:32
|
|
|
Re: Loading Image into qtf
By: forlano on Mon, 27 August 2007 19:57
|
|
|
Re: Loading Image into qtf
By: forlano on Mon, 27 August 2007 23:38
|
|
|
Re: Loading Image into qtf
By: mirek on Tue, 28 August 2007 13:10
|
|
|
Re: Loading Image into qtf
By: forlano on Wed, 29 August 2007 00:23
|
|
|
Re: Loading Image into qtf
By: mirek on Wed, 29 August 2007 11:26
|
|
|
Re: Loading Image into qtf
By: forlano on Wed, 29 August 2007 12:21
|
|
|
Re: Loading Image into qtf
By: dmcgeoch on Tue, 28 August 2007 12:58
|
|
|
Re: Loading Image into qtf
By: guido on Tue, 28 August 2007 16:31
|
Goto Forum:
Current Time: Mon May 06 02:14:48 CEST 2024
Total time taken to generate the page: 0.01321 seconds
|