Transparent objects (PNG) on Global Floating?

I want to put a triangle shape in front of another application to use as a marker. I have a test program now with a global floating window with a rectangle and color overlay. The idea is to put a triangle pointed to 4:30 on a clock but mask out the rest of the window so only the triangle is visible. The triangle is to be draggable. I think there may be a MBS pluggin for masking that exists but not sure what it was called. Any thoughts on how to do this?

Look at the formshape example project included with Xojo.

Mac ? Windows ? Linux ?

Todd are you looking for an overlay window something like this to accomplish your overlay goals?

The net toolkit is interesting, it wasn’t the idea but is worth looking into as it could have a roll with that type of transparent look. The first target is Mac, then as a lower priority windows. No interest in Linux for this project.

I’d be interested to know how you did that overlay.

[quote=161804:@Todd Chapman]The net toolkit is interesting, it wasn’t the idea but is worth looking into as it could have a roll with that type of transparent look. The first target is Mac, then as a lower priority windows. No interest in Linux for this project.

I’d be interested to know how you did that overlay.[/quote]
I used Mac OS Lib with NSWindow. Ill post my code for that window in a few.

Thanks, that will come in handy for sure.

Todd here is the window I pulled out of my software for a test project for you. Please let me know if you have any questions.

The test project includes Mac OSLib since I am using it for the NSwindow services :slight_smile:

https://www.dropbox.com/s/beep7j89bxofpgz/FloatingWindowTest.xojo_binary_project?dl=0

I just downloaded the newest version and still can’t find a formshape file when searching the examples folder. Is this with the standard download install? Oh Ok I see the windowshape for PC only. That is the idea but first I need Mac to work.

Thanks Mike!

Hey Mike, do you need some status bar apps, I see you don’t have that many installed :wink:

HAHAHA! Thanks Sam! You know it! That is a result of my blogging and customer network designs :slight_smile:

The easiest way to achieve window transparency appears to be using the MBS plugins:

  • Add this to the Open event of a window:
call self.MakeTransparentMBS
  • Add this to the Paint event of the same window:
Dim c As CGContextMBS
c = GetCurrentCGContextMBS
c.ClearRect CGMakeRectMBS(0, 0, g.width, g.height)

This will make the window transparent but leave the controls (such as a Canvas showing a PNG with transparency) opaque. This works great when the window type is “Plain Box”. However, when the window type is set to anything that has a frame (such as Global Floating Window, as requested by Todd), only the window area will be transparent, but the title bar and window frame are still visible. Carbon apps used to use the MacProcID to turn that off, but for this no longer works for Cocoa apps.
Any suggestions on how to get rid of the title bar and frame?

This works for me on mac 10.10
https://forum.xojo.com/conversation/post/153622
basically make the window transparent by setting it not opaque and a clear background color

setOpaque(self.Handle, false)
setBackgroundColor(self.Handle, clearColor(NSClassFromString(“NSColor”)))

then hide the titlebar by setting its style

setStyle(self.Handle, 0)

Thanks, Will, that did the trick!

It is a Windows project. MacOSLib has a free form splash screen window, though.