Home » U++ Library support » RichText,QTF,RTF... » Loading Image into qtf
Re: Loading Image into qtf [message #11212 is a reply to message #11211] |
Mon, 27 August 2007 19:57 |
|
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
[quote title=forlano wrote on Mon, 27 August 2007 19:32]guido wrote on Sat, 09 June 2007 14:18 |
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.
Guido
|
Hello Guido,
I am facing your same problem, that to load a file image in a qtf document. It seems you have resolved this problem.
If you have still the correct test case may I ask you to post it?
Many thanks,
Luigi
|
No prob, I found the answer just in the reference:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
GUI_APP_MAIN
{
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)));
String qtf;
qtf << pict;
PromptOK(qtf);
}
that is practically your initial code (it didn't work at my first experiment). But still I have not uderstood the Mirek's suggestion about the use of
RichObject CreateImageObject(const Image& img, int cx = 0, int cy = 0);
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: Wed May 15 19:13:22 CEST 2024
Total time taken to generate the page: 0.01782 seconds
|