Image problems

Discussion in 'ASP .Net Web Controls' started by EricW, Jan 2, 2007.

  1. EricW

    EricW Guest

    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
     
    EricW, Jan 2, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerry J
    Replies:
    0
    Views:
    565
    Jerry J
    Jul 18, 2003
  2. Mike John
    Replies:
    0
    Views:
    531
    Mike John
    Jul 28, 2003
  3. Gary B

    Image can't hold an image?

    Gary B, Jul 31, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    360
    Steve C. Orr, MCSD
    Aug 1, 2003
  4. Jim Hammond
    Replies:
    1
    Views:
    493
    Oliver
    Nov 13, 2003
  5. Laszlo Zsolt Nagy
    Replies:
    1
    Views:
    1,418
    Kartic
    Jan 26, 2005
Loading...

Share This Page