Add icon to webpage?

Okay, somehow I managed to add two icons to my project, i think.

How do I place them on the web page?

Clear as mud. There is no “WebImageView” in the object library, so I add that code to what event exactly? And if I get that working how would I position the icon on the page?

For me too.

I do not found it too.

Nothing too in the Insert Menu.

I found the entry in the [LOCAL] documentation (plenty of entries), but that is all.

Nota: it is the heart of the night here, right now, and I will have to wake up in three hours only; this cannot explain that :wink:

Emile, just curious.

I do not know why, but I was wanting to do that in a test project last week or so, and used that same project (unchanged) minutes ago to check the anser above.

I ran it and… SURPRISE: the icon appears in the WebCanvas (Firefox) !


[code]Sub Paint(g as WebGraphics) Handles Paint
Dim Logo_FI As New FolderItem(“Caritas.png”)

If Logo_FI <> Nil And Logo_FI.Exists Then
Dim Logo_Pict As New WebPicture(Logo_FI)


MsgBox “Image not found.”
End If
End Sub[/code]

I re-run it and it does not runs. No available memory (probably).

More details in the next episode…

In the library ins listed as image Well

Maybe this could help, sometimes a picture is worth more than words:

I forget to mention:

I added a Pre-build Script to copy the icon into the application: for some reason, the path to load the icon is beside the application (inside the WebSQLiteExample.debug folder).

I have to add the .sqlite file in the script to move it to the same location ;).

Thanks. ImageWell works “well” (pun intended). I did see that too, but I thought a "well’ was too esoteric for showing a simple image.

Next, I need to make the icon clickable, meaning that when the user clicks the icon and action happens - for testing purposes, say: MsgBox(“Test”).

There is no “onClick” event which is what I am used to. I tried using the Focus event (which isn’t in the documentation, but is an option for the ImageWell; no-go. I looked at MouseUp which seems the logical event; it wants an x/y coordinate which makes no sense to me. Coordinate for what? You can’t be saying the user has to click on an exact pixel - right? What does it mean, how do i implement it in the action? To me the docs are confusing on this.

Just a detail :

What is called an Image Well in the IDE is for some reason a WebImageView.

For what you want to do, better use a WebCanvas, and it’s MouseUp event.

See the post from Emile Schwartz above to display a picture.

I appreciate the help. Unfortunately my knowledge of Xojo is very limited. I’m unable to even load an image in the canvas (and the image lives in the project) , much less enable a click event.

BTW, the ImageWell’s DoubelClick event (not documented, but in the IDE) works just fine. But the user needs a click-type event, of course.

So actually the MouseUp does work in the ImageWell after all. Interestingly, when I click on the “Check this item for errors” in the IDE it gives me some guff about x & y coordinates, but it runs nonetheless.

It is a Warning, not an error. It just says, “you are not using those parameters”.

Wants? Those are parameters of the event, not something you must provide. You should really start with the basics of the languaje.


Believe it or not, I’ve read all that stuff.

Nice Comic Strip !