Print Page | Close Window

[SOLVED] SetWatermarkBitmap handle

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=11742
Printed Date: 04 May 2024 at 4:36am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] SetWatermarkBitmap handle
Posted By: Aaron
Subject: [SOLVED] SetWatermarkBitmap handle
Date Posted: 06 August 2008 at 8:54am
Hi,
 
Why can't I do this ???
 
Dim stdPic As StdPicture
Set stdPic = ImageManager.Icons.GetImage(1, 16).CreatePicture(xtpImageNormal)
wndReportControl.SetWatermarkBitmap stdPic.Handle, 100
 
or
 
Dim stdPic As StdPicture
Set stdPic = wndReportControl.Icons.GetImage(1, 16).CreatePicture(xtpImageNormal)
wndReportControl.SetWatermarkBitmap stdPic.Handle, 100
 
or
 
wndReportControl.SetWatermarkBitmap Picture1.Picture.Handle, 100

 
 
Seems only wndReportControl.SetWatermarkBitmapFromFile <picturePath>, 100      is working.
 
Thanks for looking at it.
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....



Replies:
Posted By: jpbro
Date Posted: 06 August 2008 at 1:28pm
Confirmed here. I tried passing the picture to a Form first (to confirm the image was working) and calling SetWatermarkBitmap with the Form.Picture.Handle, but no help either. It seems that SetWatermarkBitmap returns false no matter what...

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 06 August 2008 at 1:33pm
Actually, it seems that calling SetWatermarkBitmap returns TRUE when using Me.Picture.Handle, but no watermark gets drawn.

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: AndreiM
Date Posted: 09 August 2008 at 5:25am
Hi,
It think you have to declare stdPic as a form (global) member. 
 
See line below:
    Set stdPic = ImageManager.Icons.GetImage(1, 16).CreatePicture(xtpImageNormal)
 
'CreatePicture' copy (!) image and store it in new StdPicture object.
I mean that stdPic retrieve image copy, but not a link!
 
stdPic will be destroyed when you exit your procedure and handle will be invalid.


-------------
Regards,
Andrei Melnik


Posted By: Aaron
Date Posted: 09 August 2008 at 7:57am
Hi Andrei,
 
You are right about that, it will be destroyed. But when using a PictureBox.Picture.Handle or Form.Picture.Handle should be "global" enough, don't you think? If you would be so kind and test this yourself you will see that handle is still the same and still doesn't work with SetWatermarkBitmap (See also reply of Jason)
 
Thanks
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: AndreiM
Date Posted: 14 August 2008 at 8:14am
Sorry, I was not right.
The problem is that SetWatermarkBitmap works fine only if you pass handle to alptha bitmap (or 32 bit per pixel).
SetWatermarkBitmapFromFile works fine because it convert source bitmap to alptha bitmap if need.
 
This bug will be fixed in version 12.0.2.


-------------
Regards,
Andrei Melnik


Posted By: Aaron
Date Posted: 14 August 2008 at 9:00am
Hi,
 
Thanks for fixing this
 
There's no possible solution (not that I know of) to get a handle of an alpha image. Can't use:
  • stdPicture (doesn't support alpha does return handle)
  • MS Picturebox control (doesn't support alpha / does return handle)
  • MS Image control (doesn't support alpha / does return handle)
  • CJ Imagemanager icon (supports alpha / doesn't return handle)

It would be nice if ImageManager would return handle of image. Who is in charge of the imagemanager control, I hope it's you

 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: SuperMario
Date Posted: 14 August 2008 at 1:10pm
Oleg is in charge of ImageManager


Posted By: Aaron
Date Posted: 15 August 2008 at 9:17am
Originally posted by SuperMario SuperMario wrote:

Oleg is in charge of ImageManager
 
Pssst, SuperMario, could you whisper something in Oleg's ear? Here it comes: "Would it be possible to return handle of added images" and also tell him how wonderfull the ImageManager is. And maybe give him something of your favorite SuperMario cookie  Thanks a lot in advance.
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: AndreiM
Date Posted: 15 August 2008 at 1:00pm
Hi,
XTPImageManagerIcon.Handle property will be added in 12.0.2.


-------------
Regards,
Andrei Melnik



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net