0

I want to draw a graphic over the main GUI items, from the main loop. But even tho the code responsible is last in line all the inherited items take precedence. Is there a way I can draw shapes onto the foreground while showing the GUI items below, And keep focus while doing it?

LarsTech
  • 80,625
  • 14
  • 153
  • 225
Camper
  • 3
  • 6
  • `Is there a way I can draw shapes ...` Yes. – Ňɏssa Pøngjǣrdenlarp May 13 '16 at 16:08
  • It's a Windows form with inherited picture boxes. – Camper May 13 '16 at 16:11
  • 1
    The form surface is clipped by the controls. So no. You'll have to make a sandwich, another transparent window that's layered on top of your existing one. Sample code [is here](http://stackoverflow.com/a/4503371/17034). – Hans Passant May 13 '16 at 16:14
  • Thanks!, Will try. – Camper May 13 '16 at 16:22
  • Possible duplicate of [Draw semi transparent overlay image all over the windows form having some controls](http://stackoverflow.com/questions/4503210/draw-semi-transparent-overlay-image-all-over-the-windows-form-having-some-contro) – MicroVirus May 13 '16 at 17:16
  • "Except I still want to have control over the GUI". In between chores so I can't implement the above to see, but it lingers. Would using WPF make this simpler?, I saw a tut the other day and it looked cool. – Camper May 13 '16 at 18:10
  • Maybe http://stackoverflow.com/questions/18294658/vb-net-click-through-form with reference to http://www.codeproject.com/Articles/12877/Transparent-Click-Through-Forms – OldBoyCoder May 13 '16 at 18:42
  • From the look of it it most certainly is a solution. Also I remember starting out with active caption as a transparency key and doing the transparent main window like that. Tho it does leave a bit of a bitter aftertaste disallowing me to continue my gui in the spirit of the project. (graphically made) And I think I might run into trouble later because it's for a vst plugin. Not sure what is wisdom in this scenario.. – Camper May 15 '16 at 15:50

2 Answers2

0

Ok, i'ts going to be completely different. What I'm going to try is draw the entire GUI into one picturebox before hand. So that "if" I would want to do this later it doesn't require as much change. Which leads me to another issue, I barely managed to draw my GUI object, and the array is in the same class as the GUI object drawing. So it's drawn inside the active class.

Is it even possible to have a graphic inside a class with an array being outside the class? and dumping all the graphics inside a single array? Or is this ill formed?

Now that I'm typing this I see I can just inherit a picturebox for the GUI collection class.. But still It looks like it may save some memory having a single "picture array"

Camper
  • 3
  • 6
0

Ok, I solved it by arranging it like this.

Private GFX As Graphics = (Graphics.FromImage(GUIcollection.Bmap))

Hope it makes sense.. Basically I pointed to a public shared array (in class GUIcollection named Bmap) to initialize the graphic GFX.

Camper
  • 3
  • 6