Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create a transparent rectangle with GDI+X
Message
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01387556
Message ID:
01387576
Views:
76
>Thanks Cesar, I'm digesting it now. It's very cool, but it does a lot more than what I was originally thinking I'd do and it really wants to work for the entire form - not just a portion of it. It looks like it's taking a bitmap copy of the active form and rendering it's colors to greyscale and then overlaying the form with the new image.
>
>I was working with the samples earlier and trying to do something like this:
>
>
>WITH _Screen.System.Drawing
>  Local loGfx As xfcGraphics
>  loGfx = This.oGfx 
>  loSolidBrush = .SolidBrush.New(.Color.FromArgb(120, 250, 10, 10),1) 
>  loGfx.FillRectangle(loSolidBrush, This.Rectangle)
>
>
>The problem I ran into with this is that "This.Rectangle" has a solid color of blue and when I add my loSolidBrush on top of it, the transparency is on top of the blue color.
>
>Is it possible to draw a semi-transparent rectangle?


Well,

I do really insist that the best option for you is to work with the lightbox technique. Notice that Bernard posted twice about it.
The simplest aproach is the first one. Instead of adding an image to the entireform, just change your image size and position to your grid !!!!

But I see that you wanna play with GdiPlusX.
Yeah... That's very cool !

So...


STEP 0:
PREREQUISITE: VFP9 SP2 - Without SP2, you wont have the transparency you are looking for.


STEP 1:

In Your ImageCanvas in the Setup event, add the following code:
This.RenderMode = 4 && PNG
STEP 2:

In the BeforeDraw method:
WITH _Screen.System.Drawing
  Local loGfx As xfcGraphics
  loGfx = This.oGfx 
  loGfx.Clear(.Color.Transparent)
  loSolidBrush = .SolidBrush.New(.Color.FromArgb(120, 250, 10, 10),1) 
  loGfx.FillRectangle(loSolidBrush, This.Rectangle)
This should make you go further.

Regards

Cesar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform