Hi,
I created my website so that each menu and table is drawn with commands like
DrawRectangle and DrawString.
Each of these bitmaps is then stored on the server and then loaded into an
image or imagemap control, created dynamicly.
Here's a piece of the code:
Dim bm As Drawing.Bitmap
Dim fn10 As Drawing.Font
Dim pn2 As Drawing.Pen
Dim imCopyright As New WebControls.ImageMap
Dim dsUpdate As New Data.DataSet
dsUpdate.ReadXml(Request.PhysicalApplicationPath + "\update.xml")
bm = New Drawing.Bitmap(800, 40)
bm.SetResolution(200, 200)
Dim gph As Graphics = Graphics.FromImage(bm)
fn10 = New Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Pixel)
pn2 = New Pen(Color.DarkSlateGray, 2)
gph.Clear(Color.SlateGray)
gph = CreateArea(gph, pn2, Brushes.Gray, New Point(5, 5), New Size(785,
25))
gph = DrawText(gph, fn10, Brushes.DarkSlateGray, "Design and programming ©
2007", New Point(15, 5), New Size(645, 10), "left")
gph = DrawText(gph, fn10, Brushes.DarkSlateGray, "Quotes from
http://www.quotegarden.com/", New Point(15, 18), New Size(645, 10), "left")
bm.Save(Request.PhysicalApplicationPath + "\sessiondata\" +
Session("user") + "_CopyrightView.png", Imaging.ImageFormat.Png)
Dim yy As Integer
yy = 600 + top
imCopyright.Style("top") = yy.ToString + "px"
imCopyright.Style("Left") = "0px"
imCopyright.Style("Position") = "Absolute"
imCopyright.ImageUrl = "~\sessiondata\" + Session("user") +
"_CopyrightView.png?" + Trim(Str((RandomNumber())))
imCopyright.Visible = True
Me.Controls.Add(imCopyright)
The first few times it works fine, but after a while going to the menu's
testing stuff, a lot of times the images aren't shown.
I just get the little pictogram usualy seen when the image is being loaded.
Doing a reload of the page via the reload button of IE, the page is shown
complete, but even then somtimes I have to reload it a few times.
How is this happening? Is my application going to fast for the browser?
Is this just a very bad approach? I hope not, spend quite a few hours on the
website now.
Can anyone please help me?
rg,
Eric