 |
| ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

March 25th, 2004, 01:28 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Custom images
Hello,
I see examples for creating images that are based on some sort of data (such as a data tables field that holds a percentage of something, and the image control is a bar chart). How do you create a custom image control like this?
I had an example link for you, but now I can't find it.
Thanks,
Brian Mains
__________________
Brian
|
|

March 25th, 2004, 06:35 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Well, I have looked into this as well, but not much. You should check out the drawing classes of .NET and the key words that you might use in a goggle search is GDI+, image, .NET. Here you will find a short introducion using CSharp.
Hope it helps; I am just a novice in this field as well so cannot give you more.
Jacob.
|
|

March 25th, 2004, 06:39 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ups, I did not really address the question did I!? Regarding charts... Look at this thread...
http://p2p.wrox.com/topic.asp?TOPIC_ID=9622
Jacob.
|
|

March 25th, 2004, 10:50 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
I don't know how detailed you want to get with the graphic (I created a gradient filled cylinder in Fireworks that looked pretty good), but one thing you could do if you don't want to use a custom control is to slice one 3-dimensional(either a rectangle, cylinder, whatever shape you want) bar image to create 3 images. The first one would be the left side of the bar graph and it's width would remain constant. The second image would be a very thin slice of the middle of the bar. The third image would be the right side of the image and it's width would also remain constant.
Then you would put the images in nested tables. The rows would have 3 columns. Put the first image (left side of bar graph) into the first column and set the columns width to the width of the image. Do the same with the right side (except use the 3rd image).
For the middle, set the thin sliced image as the background of the middle column and set the column's width to the percentage that is pulled from the database. If you don't want to use a graphic, you can just set the background color of the nested table to whatever color you want and set it's width to the percentage pulled from the database.
I have implemented this as an ASP component, but it should be just as easy if not easier to do it in .Net.
Hopes this helps.
J
|
|

March 26th, 2004, 04:35 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Thanks for the response. I was just curious, because I found custom web controls on other web sites (don't remember the links now). In the code they had, I never seen GDI+ objects used and such... I was just curious how they were doing it... It may be as simple as using a 1px image and stretching it (say if the percentage is 62) or something like that.
Thanks,
Brian
|
|

March 26th, 2004, 05:04 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
Yes,
I have used it for tracking site hits and it seems to work pretty well displaying the hits in a graphical manner...
J
|
|
 |