[WEB] How to set an image to a WebCanvas ?

How to set an image to a WebCanvas ?

I do not found the documentation that explain this.

Help / Hilfe / Ayuto, etc. :wink:

Please.

Draw it in the Paint event.

Merci Michel.

Used code:

[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)

g.DrawPicture(Logo_Pict,0,0)

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

I get “Image not found.”. The image is beside the Web project. My default browser display correctly the other parts of the interface (buttons, WebListBox with the data from my sqlite file).

Thus my (incomplete) question.

move the picture inside your xojo project if it is a fixed one.

Merci Jean-Yves,

…and it became a multi-dpi picture. I do not recall what was the trouble, but I started with that.
…then I wanted to put the image in the .Backdrop, but not available Backdrop Property in WebCanvas…

I wanted to add a company logo yesterday morning (@ 11h00).

I feel like Web is a brand new language. :frowning:

Just use an ImageView. Will be way simpler.

What’s that ? (typo error: you meant ImageWell ?)

I should have said WebImageView which indeed for some unknown reason is named “Image Well” in the Library.
http://documentation.xojo.com/WebImageView

I do not found it. I will come back to this tomorrow (its 1:33 now).
Thank you Michel.

Emile, just go into the right hand side of the IDE, in the Library, and drag an Image Well to the WebPage. Just like you would in Desktop.

So you know, in order to draw a picture onto a WebCanvas, you first have to create a WebFile from it, and then use that URL. All that process is automated in the WebImageView.

Michel,

I was tired yesterday and simply do not saw the desired control. I will do that after my afternoon nap.

Thanks.

Edit:
Go figure: I even move the Mouse cursor above the controls (to read the name)… tired I was !

ImageWell: found (I was really tired to not found it previously).

Display the image ? No.

I awake this night with the idea to search in the Examples folder… I searched and yes an example exists.

Funny (or not), the EELogo.png file is in the Navigator pane as an alias (it seems). I deleted it, import it (drag and drop) and it came the same as it was.

I’ve done the same withing my own project, and I get the image (that image) part of a Xojo Picture (the @1 image).

Time for an hair cut… No, I will go to the barber shop, not pulled my hair from my head using my hands ! :wink:
Yes, I had some minutes to spend before the shop opens…

Just drag a picture into your project and you will be able to use it in your Image Well.