Image

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I need to display a ranking using starts. 1 to 5.

Can I create a single star image and then create, at runtime, the
ranking image for each record using 1 to 5 stars?

How can I do this?

Thanks,

Miguel
 
Hello,

I need to display a ranking using starts. 1 to 5.

Can I create a single star image and then create, at runtime, the
ranking image for each record using 1 to 5 stars?

How can I do this?

Thanks,

Miguel

OK so if you have your "ranking" stored somewhere as say an integer 1
to 5 then one simple way would be to have 5 asp image tags and during
page load set their visible attributes to false then do a select case

select case [Your ranking score held in a variable]

case 1
imgid1.visible = true

case 2
imgid1.visible = true
imgid2.visible = true

case 3
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true

case 4
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true
imgid4.visible = true

case 5
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true
imgid4.visible = true
imgid5.visible = true

end select

For sure there would be more elegant ways of acheiving this but your
description of the problem was way to vague to offer anything else.

But the above would work.

Mark
 
I need to display a ranking using starts. 1 to 5.
Can I create a single star image and then create, at runtime, the
ranking image for each record using 1 to 5 stars?
How can I do this?

Miguel

OK so if you have your "ranking" stored somewhere as say an integer 1
to 5 then one simple way would be to have 5 asp image tags and during
page load set their visible attributes to false then do a select case

select case [Your ranking score held in a variable]

case 1
imgid1.visible = true

case 2
imgid1.visible = true
imgid2.visible = true

case 3
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true

case 4
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true
imgid4.visible = true

case 5
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true
imgid4.visible = true
imgid5.visible = true

end select

For sure there would be more elegant ways of acheiving this but your
description of the problem was way to vague to offer anything else.

But the above would work.

Mark

I was thinking more of some kind of image manipulation at runtime.

Thanks,
Miguel
 
That seems like way overkill for a star ranking system.



shapper said:
I need to display a ranking using starts. 1 to 5.
Can I create a single star image and then create, at runtime, the
ranking image for each record using 1 to 5 stars?
How can I do this?

Miguel

OK so if you have your "ranking" stored somewhere as say an integer 1
to 5 then one simple way would be to have 5 asp image tags and during
page load set their visible attributes to false then do a select case

select case [Your ranking score held in a variable]

case 1
imgid1.visible = true

case 2
imgid1.visible = true
imgid2.visible = true

case 3
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true

case 4
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true
imgid4.visible = true

case 5
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true
imgid4.visible = true
imgid5.visible = true

end select

For sure there would be more elegant ways of acheiving this but your
description of the problem was way to vague to offer anything else.

But the above would work.

Mark

I was thinking more of some kind of image manipulation at runtime.

Thanks,
Miguel
 
OK so if you have your "ranking" stored somewhere as say an integer 1
to 5 then one simple way would be to have 5 asp image tags and during
page load set their visible attributes to false then do a select case
select case [Your ranking score held in a variable]
case 1
imgid1.visible = true
case 2
imgid1.visible = true
imgid2.visible = true
case 3
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true
case 4
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true
imgid4.visible = true
case 5
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true
imgid4.visible = true
imgid5.visible = true
end select
For sure there would be more elegant ways of acheiving this but your
description of the problem was way to vague to offer anything else.
But the above would work.

I was thinking more of some kind of image manipulation at runtime.

Thanks,
Miguel- Hide quoted text -

- Show quoted text -

Sorry Miguel but I'm not sure what help you're after.

I think contributors are going to need a little more to go on.

Can you give a little more info?

Mark
 
On Oct 12, 3:29 pm, (e-mail address removed) wrote:
Hello,
I need to display a ranking using starts. 1 to 5.
Can I create a single star image and then create, at runtime, the
ranking image for each record using 1 to 5 stars?
How can I do this?
Thanks,
Miguel
OK so if you have your "ranking" stored somewhere as say an integer 1
to 5 then one simple way would be to have 5 asp image tags and during
page load set their visible attributes to false then do a select case
select case [Your ranking score held in a variable]
case 1
imgid1.visible = true
case 2
imgid1.visible = true
imgid2.visible = true
case 3
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true
case 4
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true
imgid4.visible = true
case 5
imgid1.visible = true
imgid2.visible = true
imgid3.visible = true
imgid4.visible = true
imgid5.visible = true
end select
For sure there would be more elegant ways of acheiving this but your
description of the problem was way to vague to offer anything else.
But the above would work.
Mark
I was thinking more of some kind of image manipulation at runtime.
Thanks,
Miguel- Hide quoted text -
- Show quoted text -

Sorry Miguel but I'm not sure what help you're after.

I think contributors are going to need a little more to go on.

Can you give a little more info?

Mark

Hi,

I just found good solution:
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Rating/Rating.aspx

Thanks,
Miguel
 
[cut]
I was thinking more of some kind of image manipulation at runtime.

I would do this once for all and would have just 5 images, each image being
the symbol for the corresponding level. This way you are totally free to do
what you want such as using pale colors when the rating is low and adding
glowing effects on those graphics elements.

Else the runtime manipulation could be as easy as rendering n time the same
image when the rating is n. Doing something more sophisticated would be
useless as it would produce anyway only 5 distintcs results you could just
produce once for all...
 
Back
Top