Wrox Programmer Forums
|
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
 
Old March 25th, 2004, 01:28 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default 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
 
Old March 25th, 2004, 06:35 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
 
Old March 25th, 2004, 06:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
 
Old March 25th, 2004, 10:50 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

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
 
Old March 26th, 2004, 04:35 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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
 
Old March 26th, 2004, 05:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Yes,

I have used it for tracking site hits and it seems to work pretty well displaying the hits in a graphical manner...

J





Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Server Control....Custom Property Editor ZArrinPour ASP.NET 1.0 and 1.1 Basics 1 June 15th, 2010 11:30 AM
Load Images from and Save Images to a Database cyndie VB.NET 2 August 17th, 2008 06:42 AM
Web Service, Custom Control, Custom Return Type robzyc ASP.NET 2.0 Basics 6 June 10th, 2008 08:03 AM
custom control inside custom control issues StevesonD ASP.NET 2.0 Professional 1 February 19th, 2008 06:54 PM
Custom DropDownList Control with selectable images patelhitul ASP.NET 2.0 Professional 12 December 1st, 2006 12:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.