Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find picture in richtextbox?

Status
Not open for further replies.

topcat1a

Programmer
Jan 6, 2005
34
GB
Does anyone know how to locate a picture in a richtextbox?

I am inserting text into a richtextbox then in turn to an access database. I let the user enter a picture, when this is entered i record the filename and the location of the picture in the text(taken from the selstart function) this information is stored in the access database for when the text + picture(s) is later requested.

The problem i have is what happens if the user - after inserting the picture- moves it :( I dont know how to keep track of its position?

 
I have been working on a project for nearly five months if i cant solve this problem the work will be wasted. Does anyone have any idea how i could go about this.
 
Sorry i dont understand strongm could you explain please? thanks.
 
I have one question about your method of doing this...

Are you saying that when they click somewhere in the text, then insert a picture, the picture is not actually visible at that time, but you store the location of where the virtual picture is in an access db to display later? Then if the text is changed before the picture, the position of the image needs to change, but you don't know how to update the position...?

If that is the case...

Instead of storing the location in the db... why not make a tag, such as <pic1> in the text, assosiate that tag with the image file path, and store that info in the db... then if the text changes, the position of the tag will change, so when you want to display the picture, you just replace the tag with the picture...

This method can't be tooo bad...
After all, you see the images on this web page don't you ;-)

Kind of like if I have this string...
This is some text
b
] see the wink?
You get this output:
This is some text
smilewink.gif
see the wink?


But if the string is changed to:
This is some more text
b
] see the wink?
You get this output:
This is some more text
smilewink.gif
see the wink?
 
Private Sub RichTextBox1_SelChange()
If InStr(RichTextBox1.SelRTF, "{\pict") Then
' we are dealing with an inserted picture. Other insertables are, for example, \object
' in this example we just echo the start position of the picture
Debug.Print RichTextBox1.SelStart
End If
End Sub
 
Thank you for your help again :)

i have extracted two picture tags (from the richtextboxes) i cant see a way to unique way to identify each of the pictures(So i know what oreder to put them into the database).

pic one:

{\pict\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw318\pich318\picwgoal180\pichgoal180\wmetafile8\bliptag2104073449{\*\blipuid 2f797066dfcc7dd7d1495b8714c065c9}

pic two:

{\pict\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw318\pich318\picwgoal180\pichgoal180\wmetafile8\bliptag2104073449{\*\blipuid 2f797066dfcc7dd7d1495b8714c065c9}

When I come to look for the pictures I need to identify them uniquely (So i can record each of the pictures seperatly and there postitions when i insert them into the database) any identifier e.g. filename
Do you know?

Again thank you very much for your help.
 
I'm using the bliptag to uniquely identify each image. So if I can get the bliptag of the image I can then, when entering the location of the image into the database search for its bliptag in the richtextbox.

I know how to find it after it has been entered and record its location. I'm dont know how to get the bliptag of the image when the user inserts the picture to start with.

I'm so close :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top