Quantcast
Viewing all articles
Browse latest Browse all 15795

VB6 The real transparent (translucent) control of the user control

HOW TO Convert to VB6 code?

FROM :c# The real transparent (translucent) control of the user control and the realization of the effect of the control
https://doc.docsou.com/b646c135a4591...505e6d7ac.html

Implementation principle:
Use paint on the uppermost layer of overlapping controls to reassemble all the intersecting parts of all lower controls that intersect with him to achieve a transparent effect.

Core code:
Code:

int index = Parent.Controls.GetChildIndex(this);

for (int i = Parent.Controls.Count - 1; i > index; i--)

{

Control c = Parent.Controls[i];

if (c.Bounds.IntersectsWith(Bounds) && c.Visible)

{

Bitmap bmp = new Bitmap(c.Width, c.Height, g);

c.DrawToBitmap(bmp, c.ClientRectangle);

g.TranslateTransform(c.Left - Left, c.Top - Top);

g.DrawImageUnscaled(bmp, Point.Empty);

g.TranslateTransform(Left - c.Left, Top - c.Top);

bmp.Dispose();

}

}

Attached Images
Image may be NSFW.
Clik here to view.
 

Viewing all articles
Browse latest Browse all 15795

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>