Display Image with Overlay Graphics in UILayout

Hello,

is it possible in 2.5s bpy to display an Image in a regular UILayout and place a rectangle on top of it? If not in UILayout, might I use UVImage-Editor in some way for that?

I in detail need the following: A user has to be able to drag a rectangle area over an Image/Texture, a bit like a select-box, but the selection has to be square and with fixed width/height.

You can place images, over objects, they can be fixed or videos… but it sounds like you want an active item but don’t say if it’s the 3D window, a tool window or … what exactly it is you’re trying to do - other than the last sentence which isn’t a UI action definition other than “cube over object”. If you’re trying to select/edit an area of a UV texture (image edit) - try GIMP.

No, you can’t

The UI does not support any kind of image or icon (other than the ones built in).

There is no event system either. So you can’t get mouse or click feedback.

Then I’ll rephrase… You can place an element/object in 3D space based on the user or camera view and overlay items… didn’t mean UI icon for drag/drop onto mesh or tool section; but that was my point.

Thanks for your replies. Atom guessed right. I want to display an Image within the Blender UI (a popup window for example) and the user should be able to drag a rectangle over it.

I thought that this would not be possible with bpy (Blender Python API) but maybe its possible with python itself using OpenGL?

As Atom said, there is no “event” action to respond to - (roll over in 3D space for object) - you would need a tick-feedback-intersect-in -3D-space function to do that. Blender, don’t do that… a lot of (high end) games don’t do that. If you could “capture the mouse” maybe… :slight_smile:

Thanks again. I’ve now solved it in a user-unfriendly way. All I wanted in the end have been a couple of numbers anyway. :wink: