Re: Inserted image properties...

  •  11-16-2006, 2:28 PM

    Re: Inserted image properties...

    Thanks for your reply, Adam.
     
    What I mean is that I want to modify by code the image style WIDTH and HEIGHT properties so it stretches the images but without modifiying image size so it doesn't loose quality. I would like to do that every time the user inserts an image.
     
    sptxt is the Cute editor. 
     
            Dim pos As Integer
            Dim W, H As Double
     
            pos = InStrRev(sptxt.Text.ToLower, "<img")
            If TxtW.Text <> "" And TxtH.Text <> "" Then
                W = 100
                H = (W * TxtH.Text) / TxtW.Text
            End If
            sptxt.Text = sptxt.Text.Insert(InStrRev(sptxt.Text.ToLower, "<img") + 4, " style=""position: absolute; width: " & W & "px; height: " & H & "px"" ")
     
    I look for the last inserted image pretending that the last inserted is in the last position in the text and then I add a style string. Almost always works and I set absolute position and size. The problem is that not always works because I think that not always the last inserted image is in the last position in the html text.
     
    I don't know how could I get an unique identifier that I could use to find.
     
    Any idea?
     
     
View Complete Thread