Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Property Grid
  New Posts New Posts RSS Feed - propertyitempicture
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

propertyitempicture

 Post Reply Post Reply
Author
Message Reverse Sort Order
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: propertyitempicture
    Posted: 17 April 2010 at 2:29am
Hi,
 
You have to calculate the width & height of the image yourself and use Item.PreviewWidth & Item.Height to set the desired size. 
 
If you would add the selected image to PropertyGridControl.Icons collection which knows the width & height already and use the GetImage method to get desired width & height and use these to size the PropertyGridItem... Something like this:
 
Private Sub wndPropertyGrid_ValueChanged(ByVal Item As XtremePropertyGrid.IPropertyGridItem)
    
    If Item.Type = PropertyItemPicture Then
        Me.wndPropertyGrid.Icons.RemoveIcon 999
 
        'Note: before adding image to .Icons you have to check if image is an Icon or a Bitmap
        Me.wndPropertyGrid.Icons.AddIcon Item.Value, 999, xtpImageNormal
       
        'Size PropertyGridItem
        Item.PreviewWidth = Me.wndPropertyGrid.Icons.GetImage(999, 0).Width
        Item.Height = Me.wndPropertyGrid.Icons.GetImage(999, 0).Height
    End If
End Sub
 
 
Hope this helps a little
 
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
johnp View Drop Down
Groupie
Groupie
Avatar

Joined: 21 February 2008
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote johnp Quote  Post ReplyReply Direct Link To This Post Posted: 16 April 2010 at 8:48am
Hi,
 
I've added a picture type item to my property grid with an expand button to allow the user to select the desired image. Once the image is selected I see that a tiny preview image is shown on the grid item. Is there a built in method that I can use to allow the user to view a larger version of the preview or will I need to add my own inplace button and open the image in a separate window or picture control?
 
Thanks!
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.125 seconds.