sebastianodg
Newcomer
- Joined
- Sep 17, 2008
- Messages
- 3
Another problem related to transparency..
I need to add an "adobe like" splash screen to my app.
I basically need to show an alpha blended, PNG image with shadows. and non rectangular borders.
After reading a lot of posts in different forums, i decided to override the OnPaintBackground() and OnPaint() methods of the form.
This code works: it shows the alpha blended bitmap correctly.
The problem is that, if the form needs to repaint, the transparent areas isn't updated correctly and the semi-transparent areas are less transparent.
I guess this happens due of the missing background refresh: the OnPaint() function simply paint the same bitmat without deleting what's already drawn.
Now the question: how can i "delete" the previous drawn bitmap?
Filling all the area with a transparent brush will not work...
Calling Invalidate() will not work..
Thanks to you all!
I need to add an "adobe like" splash screen to my app.
I basically need to show an alpha blended, PNG image with shadows. and non rectangular borders.
After reading a lot of posts in different forums, i decided to override the OnPaintBackground() and OnPaint() methods of the form.
Code:
protected override void OnPaintBackground(PaintEventArgs pevent)
{
}
protected override void OnPaint(PaintEventArgs e)
{
Image m_imgSplashScreen = Image.FromFile(m_strApplicationFolder + "splash_screen.png");
Graphics gfxGraphics = e.Graphics;
gfxGraphics.DrawImage(m_imgSplashScreen, new Rectangle(0, 0, this.Width, this.Height));
}
The problem is that, if the form needs to repaint, the transparent areas isn't updated correctly and the semi-transparent areas are less transparent.
I guess this happens due of the missing background refresh: the OnPaint() function simply paint the same bitmat without deleting what's already drawn.
Now the question: how can i "delete" the previous drawn bitmap?
Filling all the area with a transparent brush will not work...
Calling Invalidate() will not work..
Thanks to you all!
Last edited: