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 : Friday, May 12, 2006 7:18:36 AM(UTC)
kaarthic

Groups: Registered
Posts: 3


Hi

I am trying to apply an watermark from a transparent image to an JPG , here is the code, its not working, please help

Dim RasterProc As New LEADRasterProcess

Dim RasterIO As New LEADRasterIO

Dim raster1 As New LEADRaster

Dim raster2 As New LEADRaster

Dim raster3 As New LEADRaster

'Watermark file

RasterIO.Load raster2, "c:\logo.png", 0, 0, 1

'Normal file

RasterIO.Load raster1, "c:\kk1.jpg", 0, 0, 1

raster2.Bitmap = raster2.BitmapAlpha

raster3.CreateBitmap raster2.BitmapWidth, raster2.BitmapHeight, 24

raster3.SetRgnRoundRect 0, 0, raster2.BitmapWidth, raster2.BitmapHeight, raster2.BitmapWidth, raster2.BitmapHeight, L_RGN_SET

RasterProc.CreateFadedMask raster2, raster3, 60, 20, 3, 0, FADE_DUMPFILL + FADE_NOTRANSPARENCY, 255, RGB(0, 0, 255)

RasterProc.FeatherAlphaBlend raster1, 0, 0, raster1.BitmapWidth, raster1.BitmapHeight, raster2, 0, 0, raster3

RasterIO.Save raster1, "c:\test.jpg", FILE_JPEG, raster1.BitmapBits, QFACTOR_ABCQ_ENHANCE, 0

 

Thanks

Kaarthic

 

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 : Tuesday, May 16, 2006 4:08:33 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

Please try to use the following code instead of using FeatherAlphaBlend method:
+---------------------------+
Private Sub Command1_Click()
Dim RasterProc As New LEADRasterProcess
Dim RasterIO As New LEADRasterIO
RasterIO.Load LEADRasterView2.Raster, "logo.png", 0, 0, 1
RasterIO.Load LEADRasterView1.Raster, "kk1.jpg", 0, 0, 1
LEADRasterView2.Raster.Bitmap = LEADRasterView2.Raster.BitmapAlpha
LEADRasterView2.Raster.SetRgnColor RGB(0, 0, 0), L_RGN_SETNOT
RasterProc.CombineExt LEADRasterView1.Raster, 0, 0, LEADRasterView2.Raster.BitmapWidth, LEADRasterView2.Raster.BitmapHeight, LEADRasterView2.Raster, 0, 0, CB_OP_AVG + CB_DST_1
LEADRasterView3.Raster.Bitmap = LEADRasterView1.Raster.Bitmap
End Sub
+---------------------------+

Please try to use the above code and let me know if this helps.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
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.082 seconds.