Author |
Topic |
|
john_siggy@yahoo.com
USA
158 Posts |
Posted - Jun 14 2019 : 02:34:31
|
What is the fastest way to burn Opaque text into a bitmap. Have two lines of text and each is centered.
Regards,
John
|
|
john_siggy@yahoo.com
USA
158 Posts |
Posted - Jun 14 2019 : 04:07:01
|
I use the following code but I get a message that GDI is not present on my machine???:
with TImageEnView.Create(nil) do begin Bitmap.Assign(bmp); LayersAdd( 'test test 123', 22, clRed, DERFONT, [fsBold], IELayer_Pos_HCenter, IELayer_Pos_VCenter); CurrentLayer.PosX := IELayer_Pos_HCenter; CurrentLayer.PosY := IELayer_Pos_VCenter; CurrentLayer.FillColor := clWhite; CurrentLayer.BorderColor := clNone; CurrentLayer.Opacity := 0.4; LayersMergeAll(); bmp.Assign(bitmap); Free; end;
|
|
|
john_siggy@yahoo.com
USA
158 Posts |
Posted - Jun 14 2019 : 04:37:47
|
The specific error I get is: 'Cannot create TIECanvas. Ensure GDI+ is installed on system.' I am running Windows 10, Imageen Version: 8.1.1 |
|
|
xequte
38608 Posts |
Posted - Jun 16 2019 : 16:10:34
|
Hi John
Sorry, our forum software does not support the @ symbol in URL's. It needs to be encoded (%40).
Which line generates the GDI+ error?
Nigel Xequte Software www.imageen.com
|
|
|
john_siggy@yahoo.com
USA
158 Posts |
Posted - Jun 17 2019 : 21:06:57
|
Blows up at "Bitmap.Assign(bmp)
Works intermitantly
Thanks again, |
|
|
xequte
38608 Posts |
Posted - Jun 18 2019 : 00:27:21
|
OK, don't use TImageEnView.Bitmap. It is only for legacy applications, and forces use of LegacyBitmap.
Please change your code to...
with TImageEnView.Create(nil) do
begin
IEBitmap.Assign(bmp);
...
end;
Nigel Xequte Software www.imageen.com
|
|
|
john_siggy@yahoo.com
USA
158 Posts |
Posted - Jun 19 2019 : 10:36:33
|
Works for several seconds then freezes app. or gives same error about GDI+ not installed.
How much slower are the more stable "TextOut" routines anyway ?
|
|
|
john_siggy@yahoo.com
USA
158 Posts |
Posted - Jun 19 2019 : 13:14:06
|
FYI: Am running this routine 15 times a second or so... |
|
|
xequte
38608 Posts |
Posted - Jun 19 2019 : 15:42:33
|
Hi
I would not recommend creating and destroying a layer 15 times a second!
You would be better to use a TextOut routine, which calls the GDI routines directly.
But something that is used that frequently should be cached. TextOut to a iebitmap and draw that instead.
Nigel Xequte Software www.imageen.com
|
|
|
john_siggy@yahoo.com
USA
158 Posts |
Posted - Jun 23 2019 : 13:42:04
|
Thanks for your response.
I am using TextOut to a TBitmap. Is this slower than TextOut to a TIEBitmap. No caching necessary ?? |
|
|
xequte
38608 Posts |
Posted - Jun 23 2019 : 21:09:11
|
Hi John
As you don't need transparency, Bitmap textout is fine. I should imagine the time is about the same as TIEBitmap GDI+ DrawString, or possibly a little faster due to less overhead.
Only you can decide if performance is acceptible without caching the drawn bitmap. Personally speaking for an operation repeated so frequently, I would cache it.
Nigel Xequte Software www.imageen.com
|
|
|
|
Topic |
|