Re: Draw Rectangle directly to client (ie - without bitmap?)
- From: NathanC <NathanC@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 8 Jun 2007 10:22:00 -0700
I'm an idiot - I was calling seat.Clear earlier in the code - that fixed it.
What a dummy.
Thanks,
"NathanC" wrote:
I'll look into that - here is my code:.
Dim i As Int32
For i = 0 To dvGetSeatsByScreen.Count - 1
dvGetSeatStatus.RowFilter = "id='" &
dsGetSeatsByScreen.Tables("Table").Rows(i).Item("seat_status").ToString() &
"'"
fore_color = dvGetSeatStatus(0)("fore_color").ToString()
back_color = dvGetSeatStatus(0)("back_color").ToString()
status_legend = dvGetSeatStatus(0)("status_legend").ToString()
fore_color = Drawing.Color.FromArgb(fore_color)
back_color = Drawing.Color.FromArgb(back_color)
xpos =
Convert.ToInt32(dsGetSeatsByScreen.Tables("Table").Rows(i).Item("xpos").ToString())
ypos =
Convert.ToInt32(dsGetSeatsByScreen.Tables("Table").Rows(i).Item("xpos").ToString())
seat.DrawRectangle(Drawing.Pens.Black, xpos, ypos, 5, 10)
seat.FillRectangle(Drawing.Brushes.Crimson, xpos, ypos, 5, 10)
Next
Response.ContentType = "image/gif"
bitmap.Save("C:\Inetpub\wwwroot\Tessitura\images\" &
ViewSelection.SelectedItem.Text & ".gif", Drawing.Imaging.ImageFormat.Gif)
"Bob Powell [MVP]" wrote:
I'm assuming that your drawing to the screen and your stuff is disappearing
between draw cycles.
Are you respecting the laws of GetGraphics? (See the GDI+ FAQ)
Perhaps you should draw your rectangles to an image in memory and then
display that instead.
--
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"NathanC" <NathanC@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E9B4D871-5909-476F-9D90-42E78DFA4570@xxxxxxxxxxxxxxxx
I am trying to draw a rectangle for every record in a dataset.
The drawing function will occur within a For Each loop and each record has
a
different XY position, so the idea is that the final result will have a
single image with multiple rectangles. I have tried using bitmap
methodology
of doing this, but that doesn't get multiple objects on the image - only
the
final item is saved and displayed.
Is there a way that I can draw the rectangle directly to the client, and
then next iteration through the loop, draw a different rectangle in a new
location without losing the last image?
Thanks,
- References:
- Re: Draw Rectangle directly to client (ie - without bitmap?)
- From: Bob Powell [MVP]
- Re: Draw Rectangle directly to client (ie - without bitmap?)
- From: NathanC
- Re: Draw Rectangle directly to client (ie - without bitmap?)
- Prev by Date: Re: Draw Rectangle directly to client (ie - without bitmap?)
- Next by Date: Re: Simple PictureBox questions
- Previous by thread: Re: Draw Rectangle directly to client (ie - without bitmap?)
- Index(es):
Relevant Pages
|