Print Page | Close Window

Custom picture in ReportControl

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=17692
Printed Date: 17 July 2025 at 9:01pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Custom picture in ReportControl
Posted By: rdeboer
Subject: Custom picture in ReportControl
Date Posted: 16 December 2010 at 3:28pm
Hi,

I add a custom snapshot of a picture to a reportcontrol like this:

imgPrimary.Picture = LoadPicture(GetTmpPath & "\snapshot.jpg")
ListMovies.Icons.AddBitmap imgPrimary.Picture, ListMovies.Rows.Count, xtpImageNormal, False

So far so good. The picture shows in the 1st cell of the row.

Now, when i click on a row, i want to get that picture and display it in a PictureBox. I tried this:

Picture2.Picture = ListMovies.Icons.GetImage(1, 128)

But that doesn't do the trick

Can anyone help?


-------------
Product: Xtreme Suite Pro (ActiveX) version 11
Platform: Windows XP SP3 (32bit)
Language: Visual Basic 6.0 SP6



Replies:
Posted By: jpbro
Date Posted: 16 December 2010 at 4:04pm
If you attach a small sample project with code & picture, I will try and get it working for you.

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

Language: Visual Basic 6.0 SP6



Posted By: Aaron
Date Posted: 17 December 2010 at 5:09am

Hi,

Try this instead:

Picture1.Picture = Me.ImageManager1.Icons.GetImage(1, 128).CreatePicture(xtpImageNormal)

Note: if your image is an alpha image this doesn't work because PictureBox object doesn't support 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....


Posted By: rdeboer
Date Posted: 17 December 2010 at 6:09pm
Thanks, it worked out, but i also found out that if an image has alpha parts (like you said) it looks really ugly.

I remember some code that could add a custom control to a cell in the ReportControl, but i can't find it anywhere in the forum.

Best solution for me would be adding a picturebox or image to the cell.

Anyone got vb6 code or an example for that?

Would MarkUpImage be able to do the job?






-------------
Product: Xtreme Suite Pro (ActiveX) version 11
Platform: Windows XP SP3 (32bit)
Language: Visual Basic 6.0 SP6


Posted By: Aaron
Date Posted: 18 December 2010 at 2:35am

Hi,

Just load images in .Icons collecting and assign icon to ReportItem.IconIndex, no need for adding extra controls...

  


-------------
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: rdeboer
Date Posted: 18 December 2010 at 9:27am
That's what i did, but some images look ugly in the list.

It's not the image itself, wich looks perfect in PictureBox, its the way ReportControl shows them:




-------------
Product: Xtreme Suite Pro (ActiveX) version 11
Platform: Windows XP SP3 (32bit)
Language: Visual Basic 6.0 SP6


Posted By: jpbro
Date Posted: 18 December 2010 at 12:15pm
Try Me.ReportControl1.Icons.MaskColor = -1

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

Language: Visual Basic 6.0 SP6



Posted By: rdeboer
Date Posted: 18 December 2010 at 1:57pm
ListMovies.Icons.MaskColor = 0 did the trick!

Thanks again for your help Tongue


-------------
Product: Xtreme Suite Pro (ActiveX) version 11
Platform: Windows XP SP3 (32bit)
Language: Visual Basic 6.0 SP6



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