Inserted image properties...

Last post 11-16-2006, 2:28 PM by raul_xl. 2 replies.
Sort Posts: Previous Next
  •  11-16-2006, 12:15 PM 24363

    Inserted image properties...

    Hi everybody,
     
    Whenever a user inserts an image I would like to do something. Let's say that what I want is that the user doesn't have to push absolute button and stretch the image everytime is inserted. Instead I would like to do that by code every time an image is inserted and insert that image with absolute position and 200px width (width in the editor but not image width).
     
    Anyone can help me.
  •  11-16-2006, 12:30 PM 24364 in reply to 24363

    Re: Inserted image properties...

     
    This feature is not supported by default.  To achive that result, you need to modify the source code.
     
    >>200px width (width in the editor but not image width).
     
    Not sure what you mean. Can you explain this in more details?
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  11-16-2006, 2:28 PM 24368 in reply to 24364

    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 as RSS news feed in XML