![]()  | 
 
[SOLVED] SetWatermarkBitmap handle | 
 
    Post Reply  
   | 
  
| Author | |
   
   Aaron  
   
   Senior Member  
   Joined: 29 January 2008 Status: Offline Points: 2192  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: [SOLVED] SetWatermarkBitmap handlePosted: 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....  | 
 |
![]()  | 
 |
   
   jpbro  
   
   Senior Member  
   Joined: 12 January 2007 Status: Offline Points: 1357  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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  | 
 |
![]()  | 
 |
   
   jpbro  
   
   Senior Member  
   Joined: 12 January 2007 Status: Offline Points: 1357  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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  | 
 |
![]()  | 
 |
   
   AndreiM  
   
   Moderator Group  
   Joined: 18 August 2007 Status: Offline Points: 132  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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.  | 
 |
![]()  | 
 |
   
   Aaron  
   
   Senior Member  
   Joined: 29 January 2008 Status: Offline Points: 2192  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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....  | 
 |
![]()  | 
 |
   
   AndreiM  
   
   Moderator Group  
   Joined: 18 August 2007 Status: Offline Points: 132  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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. 
    | 
 |
![]()  | 
 |
   
   Aaron  
   
   Senior Member  
   Joined: 29 January 2008 Status: Offline Points: 2192  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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:  
 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....  | 
 |
![]()  | 
 |
   
   SuperMario  
   
   Senior Member  
    
   Joined: 14 February 2004 Status: Offline Points: 18057  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 14 August 2008 at 1:10pm | 
 
| 
   
    
   Oleg is in charge of ImageManager
    
   
   | 
 |
![]()  | 
 |
   
   Aaron  
   
   Senior Member  
   Joined: 29 January 2008 Status: Offline Points: 2192  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 15 August 2008 at 9:17am | 
 
   
   
 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....  | 
 |
![]()  | 
 |
   
   AndreiM  
   
   Moderator Group  
   Joined: 18 August 2007 Status: Offline Points: 132  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 15 August 2008 at 1:00pm | 
 
| 
   
    
   Hi,
 
   
  XTPImageManagerIcon.Handle property will be added in 12.0.2. 
    | 
 |
![]()  | 
 |
    Post Reply  
   | 
  |
|       
  
  Tweet   	
    | 
 
| Forum Jump | Forum Permissions  ![]() 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  |