Connecting Tech Pros Worldwide Forums | Help | Site Map

Bad Flicker, TransparencyKey and ControlPaint.DrawReversibleFrame

Rainer Queck
Guest
 
Posts: n/a
#1: Nov 11 '08
Hello NG,

I had/have a bad flicker Problem with my Application.
On starting some applications, while my app was running, the whole Display
started to flicker. Even the desktop Icons!

Looking for help on this issue, I ran over a anser Linda Liu [MSFT] at :
http://groups.google.de/group/micros...b96b048f?hl=de

where I found the following (quick and dirty )solution to the flicker
problem which as describe is a bug in WinForms:

"In addition, The quick and dirty way to avoid most flicker is to use a
transparency key. Pick a color that won't affect your program such as lime
green, or some other ugly color that is not used by anything on your form"

Adding the transparency key to my form solved the flicker problem. No more
flicker at all, BUT:
In my app I am using the ControlPaint.DrawReversibleFram(..) method to draw
a "rubberband".

Now, with the transparency key set, the rubber band is no longer visible!

What can I do to get my rubber band back without having to live with the
flicker?

Thanks for help and hints!

Regards
Rainer Queck



Zhi-Xin Ye [MSFT]
Guest
 
Posts: n/a
#2: Nov 12 '08

re: Bad Flicker, TransparencyKey and ControlPaint.DrawReversibleFrame


Hello Rainer,

I can reproduce this problem. When specify a TransparencyKey for the form,
the form become a layered window, it seems that
ControlPaint.DrawReversibleFrame() method draws figures beneath the layered
window. Anyway, you can call the Rectangle() API to draw the rubber band on
the form, and call ControlPaint.DrawReversibleFrame() method to draw rubber
band outside the form.

For example:

private void MyDrawReversibleRectangle(Point p1, Point p2)
{
Rectangle rc = new Rectangle();

GDI32 gdi = new GDI32();
gdi.DrawRectangle(this.CreateGraphics(), p1, p2);


// Convert the points to screen coordinates.
p1 = PointToScreen(p1);
p2 = PointToScreen(p2);
// Normalize the rectangle.
if (p1.X < p2.X)
{
rc.X = p1.X;
rc.Width = p2.X - p1.X;
}
else
{
rc.X = p2.X;
rc.Width = p1.X - p2.X;
}
if (p1.Y < p2.Y)
{
rc.Y = p1.Y;
rc.Height = p2.Y - p1.Y;
}
else
{
rc.Y = p2.Y;
rc.Height = p1.Y - p2.Y;
}
// Draw the reversible frame.
ControlPaint.DrawReversibleFrame(rc,
Color.Black, FrameStyle.Thick);
}


The GDI32 class:


public enum RasterOps
{
R2_BLACK = 1,
R2_NOTMERGEPEN,
R2_MASKNOTPEN,
R2_NOTCOPYPEN,
R2_MASKPENNOT,
R2_NOT,
R2_XORPEN,
R2_NOTMASKPEN,
R2_MASKPEN,
R2_NOTXORPEN,
R2_NOP,
R2_MERGENOTPEN,
R2_COPYPEN,
R2_MERGEPENNOT,
R2_MERGEPEN,
R2_WHITE,
R2_LAST
}

public enum BrushStyles
{
BS_SOLID = 0,
BS_NULL = 1,
BS_HATCHED = 2,
BS_PATTERN = 3,
BS_INDEXED = 4,
BS_DIBPATTERN = 5,
BS_DIBPATTERNPT = 6,
BS_PATTERN8X8 = 7,
BS_MONOPATTERN = 9
}


public enum PenStyles
{
PS_SOLID = 0,
PS_DASH = 1,
PS_DOT = 2,
PS_DASHDOT = 3,
PS_DASHDOTDOT = 4
}

class GDI32
{
[System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll")]
private static extern bool Rectangle(IntPtr hdc, int X1, int Y1,
int X2, int Y2);
[System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll")]
private static extern IntPtr CreatePen(PenStyles enPenStyle, int
nWidth, int crColor);
[System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll")]
private static extern IntPtr CreateSolidBrush(BrushStyles
enBrushStyle, int crColor);
[System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll")]
private static extern bool DeleteObject(IntPtr hObject);
[System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll")]
private static extern IntPtr SelectObject(IntPtr hdc, IntPtr
hObject);
[System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll")]
private static extern int SetROP2(IntPtr hdc, int enDrawMode);

protected Color borderColor;
protected Color fillColor;
protected int lineWidth;
protected IntPtr hdc, oldBrush, oldPen, gdiPen, gdiBrush;
protected BrushStyles brushStyle;
protected PenStyles penStyle;

public GDI32()
{
borderColor = Color.Transparent;
fillColor = Color.White;
lineWidth = 1;
brushStyle = BrushStyles.BS_NULL;
penStyle = PenStyles.PS_SOLID;
}

public Color BrushColor
{
get { return fillColor; }
set { fillColor = value; }
}

public BrushStyles BrushStyle
{
get { return brushStyle; }
set { brushStyle = value; }
}

public Color PenColor
{
get { return borderColor; }
set { borderColor = value; }
}

public PenStyles PenStyle
{
get { return penStyle; }
set { penStyle = value; }
}

public int PenWidth
{
get { return lineWidth; }
set { lineWidth = value; }
}

protected int GetRGBFromColor(Color fromColor)
{
return fromColor.ToArgb() & 0xFFFFFF;
}

public void DrawRectangle(Graphics g, Point p1, Point p2)
{
InitPenAndBrush(g);
Rectangle(hdc, p1.X, p1.Y, p2.X, p2.Y);
Dispose(g);
}

protected void InitPenAndBrush(Graphics g)
{
hdc = g.GetHdc();
gdiPen = CreatePen(penStyle, lineWidth,
GetRGBFromColor(PenColor));
gdiBrush = CreateSolidBrush(brushStyle,
GetRGBFromColor(fillColor));
if (PenColor == Color.Transparent) SetROP2(hdc,
(int)RasterOps.R2_XORPEN);
oldPen = SelectObject(hdc, gdiPen);
oldBrush = SelectObject(hdc, gdiBrush);
}

protected void Dispose(Graphics g)
{
SelectObject(hdc, oldBrush);
SelectObject(hdc, oldPen);
DeleteObject(gdiPen);
DeleteObject(gdiBrush);
g.ReleaseHdc(hdc);
g.Dispose();
}
}

If you have any questions or concerns, please don't hesitate to let me know.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Rainer Queck
Guest
 
Posts: n/a
#3: Nov 13 '08

re: Bad Flicker, TransparencyKey and ControlPaint.DrawReversibleFrame


Hello Zhi-Xin Ye,

thank you very much for your answer.
I have tried your code, but it does not work in my application if a
Transparency key is set.
With no TransparancyKey it works, but here also the DrawReversibleFrame
works.

In addition I found an other issue caused by a set TransparencyKey:
In my application I implemented the possibillity to save screenshots to a
jpg file.
Now with the TransparencyKey set I don't get a screenshot of my application,
but of every thing what is behind it.
My app - for the screenshot - is INVISIBLE!

To generate a screenshot I use the following code:

Bitmap bm = new Bitmap(this.Width, this.Height);
using (Graphics g = Graphics.FromImage(bm))
{
g.CopyFromScreen(new Point(this.Left, this.Top), new Point(0, 0), new
Size(bm.Width, bm.Height));
string savePath = Path.Combine(myPrg.screenShotPath,
String.Format("CTS_{0}.jpg", DateTime.Now.ToString
("yyyyMMdd_HHmmss")));
if (!Directory.Exists(myPrg.screenShotPath))
{
Directory.CreateDirectory(myPrg.screenShotPath);
}
bm.Save(savePath, ImageFormat.Jpeg);
}

There is one more thing I would like to mention.
With my current application, which does a lot of grafically painting I
invested a lot of energy to keep it "managed". I would therefore appreciate
a "managed" solution to the problems.

Regards
Rainer Queck


"Zhi-Xin Ye [MSFT]" <v-zhye@online.microsoft.comschrieb im Newsbeitrag
news:cucHWvNRJHA.3440@TK2MSFTNGHUB02.phx.gbl...
Quote:
Hello Rainer,
>
I can reproduce this problem. When specify a TransparencyKey for the form,
the form become a layered window, it seems that
ControlPaint.DrawReversibleFrame() method draws figures beneath the
layered
window. Anyway, you can call the Rectangle() API to draw the rubber band
on
the form, and call ControlPaint.DrawReversibleFrame() method to draw
rubber
band outside the form.
>
For example:
>
private void MyDrawReversibleRectangle(Point p1, Point p2)
{
Rectangle rc = new Rectangle();
>
GDI32 gdi = new GDI32();
gdi.DrawRectangle(this.CreateGraphics(), p1, p2);
>
>
// Convert the points to screen coordinates.
p1 = PointToScreen(p1);
p2 = PointToScreen(p2);
// Normalize the rectangle.
if (p1.X < p2.X)
{
rc.X = p1.X;
rc.Width = p2.X - p1.X;
}
else
{
rc.X = p2.X;
rc.Width = p1.X - p2.X;
}
if (p1.Y < p2.Y)
{
rc.Y = p1.Y;
rc.Height = p2.Y - p1.Y;
}
else
{
rc.Y = p2.Y;
rc.Height = p1.Y - p2.Y;
}
// Draw the reversible frame.
ControlPaint.DrawReversibleFrame(rc,
Color.Black, FrameStyle.Thick);
}
>
>
The GDI32 class:
>
>
public enum RasterOps
{
R2_BLACK = 1,
R2_NOTMERGEPEN,
R2_MASKNOTPEN,
R2_NOTCOPYPEN,
R2_MASKPENNOT,
R2_NOT,
R2_XORPEN,
R2_NOTMASKPEN,
R2_MASKPEN,
R2_NOTXORPEN,
R2_NOP,
R2_MERGENOTPEN,
R2_COPYPEN,
R2_MERGEPENNOT,
R2_MERGEPEN,
R2_WHITE,
R2_LAST
}
>
public enum BrushStyles
{
BS_SOLID = 0,
BS_NULL = 1,
BS_HATCHED = 2,
BS_PATTERN = 3,
BS_INDEXED = 4,
BS_DIBPATTERN = 5,
BS_DIBPATTERNPT = 6,
BS_PATTERN8X8 = 7,
BS_MONOPATTERN = 9
}
>
>
public enum PenStyles
{
PS_SOLID = 0,
PS_DASH = 1,
PS_DOT = 2,
PS_DASHDOT = 3,
PS_DASHDOTDOT = 4
}
>
class GDI32
{
[System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll")]
private static extern bool Rectangle(IntPtr hdc, int X1, int Y1,
int X2, int Y2);
[System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll")]
private static extern IntPtr CreatePen(PenStyles enPenStyle, int
nWidth, int crColor);
[System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll")]
private static extern IntPtr CreateSolidBrush(BrushStyles
enBrushStyle, int crColor);
[System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll")]
private static extern bool DeleteObject(IntPtr hObject);
[System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll")]
private static extern IntPtr SelectObject(IntPtr hdc, IntPtr
hObject);
[System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll")]
private static extern int SetROP2(IntPtr hdc, int enDrawMode);
>
protected Color borderColor;
protected Color fillColor;
protected int lineWidth;
protected IntPtr hdc, oldBrush, oldPen, gdiPen, gdiBrush;
protected BrushStyles brushStyle;
protected PenStyles penStyle;
>
public GDI32()
{
borderColor = Color.Transparent;
fillColor = Color.White;
lineWidth = 1;
brushStyle = BrushStyles.BS_NULL;
penStyle = PenStyles.PS_SOLID;
}
>
public Color BrushColor
{
get { return fillColor; }
set { fillColor = value; }
}
>
public BrushStyles BrushStyle
{
get { return brushStyle; }
set { brushStyle = value; }
}
>
public Color PenColor
{
get { return borderColor; }
set { borderColor = value; }
}
>
public PenStyles PenStyle
{
get { return penStyle; }
set { penStyle = value; }
}
>
public int PenWidth
{
get { return lineWidth; }
set { lineWidth = value; }
}
>
protected int GetRGBFromColor(Color fromColor)
{
return fromColor.ToArgb() & 0xFFFFFF;
}
>
public void DrawRectangle(Graphics g, Point p1, Point p2)
{
InitPenAndBrush(g);
Rectangle(hdc, p1.X, p1.Y, p2.X, p2.Y);
Dispose(g);
}
>
protected void InitPenAndBrush(Graphics g)
{
hdc = g.GetHdc();
gdiPen = CreatePen(penStyle, lineWidth,
GetRGBFromColor(PenColor));
gdiBrush = CreateSolidBrush(brushStyle,
GetRGBFromColor(fillColor));
if (PenColor == Color.Transparent) SetROP2(hdc,
(int)RasterOps.R2_XORPEN);
oldPen = SelectObject(hdc, gdiPen);
oldBrush = SelectObject(hdc, gdiBrush);
}
>
protected void Dispose(Graphics g)
{
SelectObject(hdc, oldBrush);
SelectObject(hdc, oldPen);
DeleteObject(gdiPen);
DeleteObject(gdiBrush);
g.ReleaseHdc(hdc);
g.Dispose();
}
}
>
If you have any questions or concerns, please don't hesitate to let me
know.
>
Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team
>
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
>
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.
>
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support
Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
>

Zhi-Xin Ye [MSFT]
Guest
 
Posts: n/a
#4: Nov 14 '08

re: Bad Flicker, TransparencyKey and ControlPaint.DrawReversibleFrame


Hello Rainer,

Have you tried other ways to avoid the flicker? For example the
DoubleBuffer property or WS_EX_COMPOSITED style. You can check the
discussion in this thread:

Flicker-free painting
http://forums.microsoft.com/msdn/Sho...44742&SiteID=1

If only the TransparancyKey trick can kill the flicker on your application,
a managed way to draw the rubber band on the form is to handle the Paint
event(or override the OnPaint method) of the form, and call the
Graphics.DrawRectangle() method to draw the rubber band on the form.
However, for drawing rubber band outside the form, you can still use the
ControlPaint.DrawReversibleFrame() method.

=== Code Sample For Your Information ====

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.TransparencyKey = Color.SaddleBrown;

this.Load += new EventHandler(Form1_Load);
}

void Form1_Load(object sender, EventArgs e)
{
MouseDown += new MouseEventHandler(MyMouseDown);
MouseUp += new MouseEventHandler(MyMouseUp);
MouseMove += new MouseEventHandler(MyMouseMove);
bHaveMouse = false;
}

protected override void OnPaint(PaintEventArgs e)
{
if (bHaveMouse)
{
using (Pen p = new Pen(Color.Black))
{
p.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
//Use the DrawRectangle() method to draw a rubber band
on the form.
e.Graphics.DrawRectangle(p,
ptOriginal.X, ptOriginal.Y,
ptLast.X - ptOriginal.X, ptLast.Y - ptOriginal.Y);
}
}
base.OnPaint(e);
}

Boolean bHaveMouse;
Point ptOriginal = new Point();
Point ptLast = new Point();

// Called when the left mouse button is pressed.
public void MyMouseDown(Object sender, MouseEventArgs e)
{
// Make a note that we "have the mouse".
bHaveMouse = true;
// Store the "starting point" for this rubber-band rectangle.
ptOriginal.X = e.X;
ptOriginal.Y = e.Y;
// Special value lets us know that no previous
// rectangle needs to be erased.
ptLast.X = -1;
ptLast.Y = -1;

}
// Convert and normalize the points and draw the reversible frame.
private void MyDrawReversibleRectangle(Point p1, Point p2)
{
Rectangle rc = new Rectangle();

// Convert the points to screen coordinates.
p1 = PointToScreen(p1);
p2 = PointToScreen(p2);
// Normalize the rectangle.
if (p1.X < p2.X)
{
rc.X = p1.X;
rc.Width = p2.X - p1.X;
}
else
{
rc.X = p2.X;
rc.Width = p1.X - p2.X;
}
if (p1.Y < p2.Y)
{
rc.Y = p1.Y;
rc.Height = p2.Y - p1.Y;
}
else
{
rc.Y = p2.Y;
rc.Height = p1.Y - p2.Y;
}
// Draw the reversible frame.
ControlPaint.DrawReversibleFrame(rc,
Color.Black, FrameStyle.Dashed);
}
// Called when the left mouse button is released.
public void MyMouseUp(Object sender, MouseEventArgs e)
{
// Set internal flag to know we no longer "have the mouse".
bHaveMouse = false;
// If we have drawn previously, draw again in that spot
// to remove the lines.
if (ptLast.X != -1)
{
Point ptCurrent = new Point(e.X, e.Y);
MyDrawReversibleRectangle(ptOriginal, ptLast);
}
// Set flags to know that there is no "previous" line to
reverse.
ptLast.X = -1;
ptLast.Y = -1;
ptOriginal.X = -1;
ptOriginal.Y = -1;

this.Invalidate();
}
// Called when the mouse is moved.
public void MyMouseMove(Object sender, MouseEventArgs e)
{
Point ptCurrent = new Point(e.X, e.Y);
// If we "have the mouse", then we draw our lines.
if (bHaveMouse)
{
// If we have drawn previously, draw again in
// that spot to remove the lines.
if (ptLast.X != -1)
{
MyDrawReversibleRectangle(ptOriginal, ptLast);
}
// Update last point.
ptLast = ptCurrent;
// Draw new lines.
MyDrawReversibleRectangle(ptOriginal, ptCurrent);

this.Invalidate();
}
}
}

=============================

For generating screenshots, you can call the Form.DrawToBitmap() method
instead, for example:

private void button1_Click(object sender, EventArgs e)
{
Bitmap bmp = new Bitmap(this.Width, this.Height);
this.DrawToBitmap(bmp, new Rectangle(0, 0, this.Width,
this.Height));
bmp.Save(@"c:\test.png");
}

For more discussion on the TransparencyKey and generating screenshot, you
can read this thread:

copyFromScreen - no alpha window captured
http://forums.microsoft.com/MSDN/Sho...89138&SiteID=1

Please try my suggestions, and feel free to let me know if you have any
questions or concerns.

Have a great day!

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.




Rainer Queck
Guest
 
Posts: n/a
#5: Nov 17 '08

re: Bad Flicker, TransparencyKey and ControlPaint.DrawReversibleFrame


Hello Zhi-Xin,

some how I can't achieve a satisfying solution to my problem.I tried "2." but it did not bring the hoped for result.

On "1." I am not so sure, on how to apply the DoubleBuffering.
Could you please explainme a bit more detailed - or give me a link to a
detailed explaination - how to apply the double buffering?

Also I think, it might be a good idea to reproduce the problem with a
separate "simple" applicaton and then try the steps you described to solve
it. Currently it is kind of hard to implement your suggestions into my quite
complex application.

Regards
Rainer


Zhi-Xin Ye [MSFT]
Guest
 
Posts: n/a
#6: Nov 18 '08

re: Bad Flicker, TransparencyKey and ControlPaint.DrawReversibleFrame


Hello Rainer,

You can enable default double buffering in your forms and authored controls
in two ways. You can either set the DoubleBuffered property to true, or you
can call the SetStyle method to set the OptimizedDoubleBuffer flag to true.
Both methods will enable default double buffering for your form or control
and provide flicker-free graphics rendering.
For more information how to do this, you can refer to the following
documents:

How to: Reduce Graphics Flicker with Double Buffering for Forms and
Controls
http://msdn.microsoft.com/en-us/libr...9c(VS.80).aspx

Double Buffered Graphics
http://msdn.microsoft.com/en-us/libr...57(VS.80).aspx

If you have any questions or concerns, please don't hesitate to let me know.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.

Rainer Queck
Guest
 
Posts: n/a
#7: Nov 19 '08

re: Bad Flicker, TransparencyKey and ControlPaint.DrawReversibleFrame


Hello Zhi-Xin,

I now have managed to get the double bufferting to work and I found the
cause of my "understanding" problem.
Actualy it was no understanding problem, but a "TabControl" problem. With
the "TransparencyIssues" project which I sent you by e-mail, I realized,
that if "this.DoubleBuffered = true;" was set, wihle the TabControl existed,
the "Form1_Paint" event handler wasn't called any more. As I removed the
tabcontrol, Form1_Paint was called again.

Actually, the bad flickering problem was not solved with double buffering.
It only gets solved by setting the TransparencyKey to a Color (I sent you a
email with a 2MB avi screen video showing the flicker problem).

By the way, I managed to solve the problem the problem with the rubber band
rectangle, by drawing it directly to the bitmap. Also I solved the
screenshot problem but I had to use the following code, becaus I do not only
need the Applications main form, but also secondary windows opend by the
form at the screenshot moment:

User32.keybd_event(0x2c, 0, 0, IntPtr.Zero);
Application.DoEvents();
Image img = Clipboard.GetImage();
string savePath = Path.Combine(PrgCutSyn.screenShotPath,
String.Format("CTS_{0}.jpg",
DateTime.Now.ToString("yyyyMMdd_HHmmss")));
img.Save(savePath, ImageFormat.Jpeg);

Now that I thought, I have most of my problems solved (except of the "timer
not fired" issue) I tried my application on the target system, which is a
quite low performance industrial PC (800 MHz, 256 MB Memory). My application
now eats up all the CPU power and loads the target CPU with 100%, only
caused by the TransparencyKey !! If I do not assign a TransparencyKey, the
CPU load is at 37%.

100% is absolutely not acceptable!

So all in all I think, TransparencyKey and TabControl has MAJOR PROBLEMS!

Is there any chance to get all this issues solved some how?

Regards
Rainer


Zhi-Xin Ye [MSFT]
Guest
 
Posts: n/a
#8: Nov 20 '08

re: Bad Flicker, TransparencyKey and ControlPaint.DrawReversibleFrame


Hi Rainer,

I'm glad to hear that the rubber band and screenshot problems are solved.

For the "timer not fire" issue, you can try the SplitContainer control
instead, I've included a sample code in my email to you, please check it
and let me know the result.

Best Regards,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.


Rainer Queck
Guest
 
Posts: n/a
#9: Nov 20 '08

re: Bad Flicker, TransparencyKey and ControlPaint.DrawReversibleFrame


Hello Zhi-Xin,

thank you very much for your help and your efforts.
I now have workarounds to all the issues in conjunction with the TabControl
and TransparencyKey and can run the application on my high performance
developement machine. But...
I can not deploy my application to the target system, because of CPU
consumption :-(
100% CPU load, only because the TransparencyKey must be set to avoid the
flicker is not acceptable!

What can I do about that now?
Is there any chance, that these bugs in the .NET Framework get solved soon?

Regards
Rainer


"Zhi-Xin Ye [MSFT]" <v-zhye@online.microsoft.comschrieb im Newsbeitrag
news:bOHpF7tSJHA.1668@TK2MSFTNGHUB02.phx.gbl...
Quote:
Hi Rainer,
>
I'm glad to hear that the rubber band and screenshot problems are solved.
>
For the "timer not fire" issue, you can try the SplitContainer control
instead, I've included a sample code in my email to you, please check it
and let me know the result.
>
Best Regards,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team
>
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
>
This posting is provided "AS IS" with no warranties, and confers no
rights.
>
>

Closed Thread