This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, December 30, 2009 1:22:45 AM(UTC)
Groups: Registered
Posts: 26
Hi,
I am using LTDSpecialEffectsInterop16.SpecialEffectsProcessor Draw3dText_2() function to draw text on image, I can't able to make the text permanent on image while saving image to file.
RasterFXD have DrawPersistence property for that, What should I can do to make the displayed text permanent using LT16.
Thanks,
#2
Posted
:
Wednesday, December 30, 2009 6:28:49 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
The Draw3dText_2 method will paint the text on the DC handle. If the handle was obtained from an image, it will draw the text on the image data. Here's how to do it in VB6 code:
+--------------+
Dim hdcRasterImage As Long
hdcRasterImage = RasterImage2.CreateLeadDC()
processor.Draw3dText_2 hdcRasterImage, "sample text", RectDim, ... 'rest of params are the same
RasterImage2.DeleteLeadDC (hdcRasterImage)
+--------------+
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Wednesday, December 30, 2009 7:47:36 PM(UTC)
Groups: Registered
Posts: 26
Hi Maen,
I have tried the way you suggest, the code I used is :
Dim RasterImage2 As RasterImage
Dim hdcRasterImage As Long
Set RasterImage2 = RastCodecs.Load_12("Image.dic") 'My Added Code
'--------- Code You Suggested --------------
hdcRasterImage = RasterImage2.CreateLeadDC()
processor.Draw3dText_2 hdcRasterImage, "sample text", RectDim, ... 'rest of params are the same
RasterImage2.DeleteLeadDC (hdcRasterImage)
'---------------------------------------------
'Save Image File
RastCodecs.Save_6 RasterImage2, App.Path & "\ConvertedFile.jpg", RasterImageFormat_Jpeg, 24
The problem is if I load any jpeg file this is working correctly. But in case of Dicom file the CreateLeadDC() method returns 0 so the hSC is not created, resulting into error for Draw3dText_2 as the hDC is 0 in this case.
Thanks,
#4
Posted
:
Wednesday, December 30, 2009 9:14:47 PM(UTC)
Groups: Registered
Posts: 26
Hi Maen,
I tried method of RasterImage2 MakeGdiPlusCompatible(). And it works for dicom image as well. I done it as :
Set RasterImage2 = RastCodecs.Load_12("Image.dic") 'My Added Code
RasterImage2.MakeGdiPlusCompatible PixelFormat_DontCare, True 'New Added Line before CreateLeadDC()
Well I hope everything going to be perfect for now ..
Thanks alot,
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.