Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Image problems

Reply
Thread Tools

Image problems

 
 
EricW
Guest
Posts: n/a
 
      01-02-2007
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, 1, 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




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wx.Image: Couldn't add an image to the image list. Laszlo Zsolt Nagy Python 1 01-26-2005 09:55 PM
Does WebControls.Image actually contain an image? Jim Hammond ASP .Net 1 11-13-2003 01:20 AM
Image can't hold an image? Gary B ASP .Net 3 08-01-2003 01:31 AM
How To Browse for an image file and save it to image server folder Mike John ASP .Net 0 07-28-2003 04:55 PM
Streaming Image data to an image viewer Jerry J ASP .Net 0 07-18-2003 01:33 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57