Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] SetWatermarkBitmap handle
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] SetWatermarkBitmap handle

 Post Reply Post Reply
Author
Message
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] SetWatermarkBitmap handle
    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....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 14 August 2008 at 1:10pm
Oleg is in charge of ImageManager
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 15 August 2008 at 1:00pm
Hi,
XTPImageManagerIcon.Handle property will be added in 12.0.2.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.