Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Custom picture in ReportControl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Custom picture in ReportControl

 Post Reply Post Reply
Author
Message
rdeboer View Drop Down
Groupie
Groupie


Joined: 29 April 2004
Location: Netherlands
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdeboer Quote  Post ReplyReply Direct Link To This Post Topic: Custom picture in ReportControl
    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
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

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

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: 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....
Back to Top
rdeboer View Drop Down
Groupie
Groupie


Joined: 29 April 2004
Location: Netherlands
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdeboer Quote  Post ReplyReply Direct Link To This Post 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
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: 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....
Back to Top
rdeboer View Drop Down
Groupie
Groupie


Joined: 29 April 2004
Location: Netherlands
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdeboer Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

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

Back to Top
rdeboer View Drop Down
Groupie
Groupie


Joined: 29 April 2004
Location: Netherlands
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdeboer Quote  Post ReplyReply Direct Link To This Post 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
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.172 seconds.