Print Page | Close Window

propertyitempicture

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=16607
Printed Date: 06 May 2024 at 4:55am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: propertyitempicture
Posted By: johnp
Subject: propertyitempicture
Date 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!



Replies:
Posted By: Aaron
Date 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....



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