DBRichViewEdit FieldFormat RTF and image size
DBRichViewEdit FieldFormat RTF and image size
Hi,
I'm testing with the trial version atm. We want to store a letter in our database using the DBRichViewEdit. As we're using report builder as our printing solution we added the ppDBRichView addon to report builder. After some testing I have a problem when the fieldformat of the DBRichViewEdit is set to RVF and I try to insert an image into the edit. When I switch to the report builder print preview the ppDBRichView field doesn't show the image. There is only some richview code visible. So I tried to change the fieldformat to RTF and the ppDBRichView shows all images. But when I insert an image to the DBRichViewEdit the image will be resized to about 10 pixel in height no matter how big the image is when I post the query. When I resize the image again after posting it keeps it original size. I use the richviewactions for inserting images. When the fieldformat is set to RVF this behavior is gone. I already tried to call the Format and the Reformat function before and after posting without any effect.
Is there a special way of inserting images when the fieldformat is set to rtf so the DBRichView doesn't resize the images all the time?
I'm testing with the trial version atm. We want to store a letter in our database using the DBRichViewEdit. As we're using report builder as our printing solution we added the ppDBRichView addon to report builder. After some testing I have a problem when the fieldformat of the DBRichViewEdit is set to RVF and I try to insert an image into the edit. When I switch to the report builder print preview the ppDBRichView field doesn't show the image. There is only some richview code visible. So I tried to change the fieldformat to RTF and the ppDBRichView shows all images. But when I insert an image to the DBRichViewEdit the image will be resized to about 10 pixel in height no matter how big the image is when I post the query. When I resize the image again after posting it keeps it original size. I use the richviewactions for inserting images. When the fieldformat is set to RVF this behavior is gone. I already tried to call the Format and the Reformat function before and after posting without any effect.
Is there a special way of inserting images when the fieldformat is set to rtf so the DBRichView doesn't resize the images all the time?
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Is this a gif picture?
In this case, to load this picture from RVF, register it:
RegisterClass(TGifImage);
Call it one time before the first RVF loading.
As for RTF, there is a bug in saving sizes of converted gif picture (gif is converted to a metafile, because RTF format does not support gifs).
It is fixed in the latest version available for registered users.
In this case, to load this picture from RVF, register it:
RegisterClass(TGifImage);
Call it one time before the first RVF loading.
As for RTF, there is a bug in saving sizes of converted gif picture (gif is converted to a metafile, because RTF format does not support gifs).
It is fixed in the latest version available for registered users.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
The problem with Png is the same as with the Gifs.
In order to load RVF with these images, you need to register this class:
RegisterClass(TPngImage); // or TPngObject
But there is a difference: Png images can be stored in RTF without converting to another format. To activate this mode, call
RV_RegisterPngGraphic(TPngImage);
(one time, before the first loading-saving; defined in CRVData unit)
As for Jpegs, they must not have this problem. TRichView registers TJPEGImage itself, so it can be loaded from RVF without additional code.
Jpegs are saved to RTF without converting to another format (if rvrtfSaveJpegAsJpeg is included in RichViewEdit.RTFOptions; it is so by default).
So:
1) If you want to use RVF format, register TGifImage and TPngImage using RegisterClass.
2) If you have problem with Jpeg image saved in RTF, please send this RTF to me, I'll try to see what's wrong. The same for PNG, if the problem persists after calling RV_RegisterPngGraphic(TPngImage).
In order to load RVF with these images, you need to register this class:
RegisterClass(TPngImage); // or TPngObject
But there is a difference: Png images can be stored in RTF without converting to another format. To activate this mode, call
RV_RegisterPngGraphic(TPngImage);
(one time, before the first loading-saving; defined in CRVData unit)
As for Jpegs, they must not have this problem. TRichView registers TJPEGImage itself, so it can be loaded from RVF without additional code.
Jpegs are saved to RTF without converting to another format (if rvrtfSaveJpegAsJpeg is included in RichViewEdit.RTFOptions; it is so by default).
So:
1) If you want to use RVF format, register TGifImage and TPngImage using RegisterClass.
2) If you have problem with Jpeg image saved in RTF, please send this RTF to me, I'll try to see what's wrong. The same for PNG, if the problem persists after calling RV_RegisterPngGraphic(TPngImage).
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
If changed the fieldtype of the db field from ftMemo to ftBlob without any result. Even if I want to insert an BMP image that I've made with Paint the ppDBRichView wont show it. I've tried to insert an image into a table cell and the ppDBRichView shows the table but not the image in the cell. Again no matter what kind of image I insert into the cell.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Received.
You use TJpegGraphic class instead of TJPEGImage. This is not a standard class, it must be registered with RegisterClass.
PS: as for RTF export. Only images from TJPEGImage are stored in RTF as Jpegs. TRichView just does not know that TJpegGraphic contains a jpeg image, so, when saving RTF, it will be converted to a metafile or bitmap.
You use TJpegGraphic class instead of TJPEGImage. This is not a standard class, it must be registered with RegisterClass.
PS: as for RTF export. Only images from TJPEGImage are stored in RTF as Jpegs. TRichView just does not know that TJpegGraphic contains a jpeg image, so, when saving RTF, it will be converted to a metafile or bitmap.