Hi,
I want draw a image using X,Y coordinates.(Ex- (88,50)(86,49),(87,48))
Can some body give me idea how to draw a bit map using co-cordinates.
Thx & best rgrds
Roopesh | | Roopesh Kumar Thursday, February 01, 2007 2:59 PM | Hi Roopesh
Create a new bitmap, get the graphics canvas from it and draw away
something like this should do the trick
dim bmp as new bitmap(w,h)
usingg as graphics = graphics.fromimage(bmp)
g.drawline(pen, new point(x,y), new point(x1,y1)
If x = x1 and y = y1 then you will effectively draw a single pixel point if that is what you are after
| | iProgrammer.co.uk Thursday, February 01, 2007 3:54 PM | Hi Donny,
Thanks for your help.But as i hv given in my example i have array of co-ordinates (Ex : (23,25)(34,45)(40,50),34,50), etc)
I don't want to draw line.I want to put DOT's as per the co-ordinates .(ex: ......)
Appreciate your help
Roopesh
| | Roopesh Kumar Thursday, February 01, 2007 6:33 PM | Apart from the obvious speed implications of a large array, is there a reason you cannot do something like this?
dim bmp as new drawing.bitmap(w, h)
dim g as drawing.graphics = drawing.graphics.fromimage(bmp)
for each pt as drawing.point in myarrayofpoints()
g.drawline(pens.black, pt, pt)
next | | iProgrammer.co.uk Thursday, February 01, 2007 7:09 PM | Hi Donny,
Am trying to do like this on the Web forms
Dim oBT As Bitmap = New Bitmap(300, 100)
oBT.SetPixel(28, 31, System.Drawing.Color.Red)
oBT.SetPixel(24, 51, System.Drawing.Color.Red)
oBT.SetPixel(28, 63, System.Drawing.Color.Red)
oBT.SetPixel(28, 55, System.Drawing.Color.Red)
oBT.SetPixel(28, 47, System.Drawing.Color.Red)
oBT.SetPixel(28, 27, System.Drawing.Color.Red)
oBT.SetPixel(28, 15, System.Drawing.Color.Red)
oBT.SetPixel(28, 7, System.Drawing.Color.Red)
oBT.SetPixel(32, 0, System.Drawing.Color.Red)
oBT.SetPixel(40, 0, System.Drawing.Color.Red)
oBT.SetPixel(48, 7, System.Drawing.Color.Red)
oBT.SetPixel(56, 15, System.Drawing.Color.Red)
oBT.SetPixel(52, 23, System.Drawing.Color.Red)
oBT.SetPixel(44, 23, System.Drawing.Color.Red)
oBT.SetPixel(36, 23, System.Drawing.Color.Red)
oBT.SetPixel(72, 55, System.Drawing.Color.Red)
oBT.SetPixel(76, 47, System.Drawing.Color.Red)
oBT.SetPixel(76, 39, System.Drawing.Color.Red)
oBT.SetPixel(80, 31, System.Drawing.Color.Red)
oBT.SetPixel(84, 23, System.Drawing.Color.Red)
oBT.SetPixel(88, 15, System.Drawing.Color.Red)
oBT.SetPixel(96, 11, System.Drawing.Color.Red)
oBT.SetPixel(100, 19, System.Drawing.Color.Red)
oBT.SetPixel(100, 27, System.Drawing.Color.Red)
oBT.SetPixel(104, 35, System.Drawing.Color.Red)
oBT.SetPixel(108, 43, System.Drawing.Color.Red)
oBT.SetPixel(104, 51, System.Drawing.Color.Red)
oBT.SetPixel(108, 59, System.Drawing.Color.Red)
oBT.SetPixel(100, 39, System.Drawing.Color.Red)
oBT.Save(Server.MapPath("SigImage5.gif"), System.Drawing.Imaging.ImageFormat.Gif)
The issue is i need to join the dotted lines on white color canvas.Any suggestions pls.
Thx & Best Rgrds
Roopesh
| | Roopesh Kumar Thursday, February 01, 2007 8:34 PM |
|