Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, December 30, 2009 1:22:45 AM(UTC)
rulingking

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,
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, December 30, 2009 6:28:49 AM(UTC)
Maen Hasan

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)
rulingking

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)
rulingking

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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.061 seconds.