Pushpins with numbers on them.

Does anyone know the URL to the red coloured Numbered pushpins that local.live uses to display a pushpin

I need numbers 1 – 25 if anyone can help me



Answer this question

Pushpins with numbers on them.

  • elodie23

    Thanks Dave,

    I belive now that these are dynamically created (I could only find the master blank one in my IE Cache)....

    I could well do with some sample code to steer me in the right direction in order to create this numbered pushpins...

    Thanks in advance...


  • Dietz

    agreed.

    Ok, to crerate a dynamic image, create a new aspx named 'Image.aspx'

    then insert following code into the Page_Load Method:

    Bitmap bmp;
    Font font;
    bmp = (Bitmap)System.Drawing.Image.FromFile(Path.Combine(Server.MapPath("images"),"circle.gif"));
    gfx = Graphics.FromImage(bmp);
    font = new Font("Arial",7);

    gfx.DrawString("1",fnt2,Brushes.Black,0,0);
    gfx.Dispose();

    Response.ContentType="image/jpeg";
    bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);

    i did not post the #using stuff, should be obvious what to add to the file.



  • Humberto10k

    JeffK_ wrote:

    agreed.

    Ok, to crerate a dynamic image, create a new aspx named 'Image.aspx'

    then insert following code into the Page_Load Method:

    Bitmap bmp;
    Font font;
    bmp = (Bitmap)System.Drawing.Image.FromFile(Path.Combine(Server.MapPath("images"),"circle.gif"));
    gfx = Graphics.FromImage(bmp);
    font = new Font("Arial",7);

    gfx.DrawString("1",fnt2,Brushes.Black,0,0);
    gfx.Dispose();

    Response.ContentType="image/jpeg";
    bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);

    i did not post the #using stuff, should be obvious what to add to the file.

    Yup, pretty much the way I would have gone - Pass in a QueryString param for the "Number" you want to display and throw that into the DrawString and you're off



  • eureka-eureka

    I keep getting errors when I try to run the code, says can't index pixelated image Then the image becomes locked and I can't rename/delete Is there something wrong with my code or certain types of gif's

    Thanks,
    Jason


  • Jacco Mintjes

    jmkueter wrote:

    I keep getting errors when I try to run the code, says can't index pixelated image Then the image becomes locked and I can't rename/delete Is there something wrong with my code or certain types of gif's

    Thanks,
    Jason

    This is a GDI+ thing - There are workarounds posted all over the net, but you could either use a JPG as the base image, or use something like the following to create a new instance of your image that is not indexed:

    try

    {

    canvas = Graphics.FromImage(renderImage);

    }

    // GDI pukes when you try to get a graphics object from an index image

    // so here's the hack!

    catch

    {

    Bitmap tmpBmp = new Bitmap(renderImage.Width, renderImage.Height);

    canvas = Graphics.FromImage(tmpBmp);

    canvas.DrawImage(renderImage, new Rectangle(0, 0, tmpBmp.Width, tmpBmp.Height), 0, 0, tmpBmp.Width, tmpBmp.Height, System.Drawing.GraphicsUnit.Pixel);

    }



  • Tim Snow

  • bkejser

    Just because they are in your cache does not mean they are not dynamically created/rendered as opposed to static images. Whats in your cache is what your browser displayed, who's to say they were not dynamically created



  • GRK

    thats not true, i got all of them in my cache, but i dont use it, because they look ugly.

    clear your cache, calc a new route with many points and look again in your cache, you'll find them there.



  • kgpretty

    It's highly possible they are dynamically generated, certainly wouldn't seem to make sense to do otherwise. All you need is a base image, then use GDI+ to overaly the numbers, based on a param to the image .... Assuming you are using .Net

    If you need help with this I could whip something up pretty quickly to do this.



  • Pushpins with numbers on them.