|
|
Home » U++ Library support » Look and Chameleon Technology » Appearance problem in TabCtrl
|
Re: Appearance problem in TabCtrl [message #32550 is a reply to message #32549] |
Tue, 24 May 2011 17:37   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
qapko wrote on Tue, 24 May 2011 10:25 | Hello,
I have appearance problem in TabCtrl on one machine running Windows XP using Ultimate++ 3211. Problem appears after setting transparent (opaque)
|
Is not transparent oposite of opaque?!
Quote: |
if(GetKind() == IMAGE_OPAQUE && paintcount == 0 && sr == Rect(sz) && IsWinNT() && w.IsGui()) {
LTIMING("Image Opaque direct set");
SetSurface(w, x, y, sz.cx, sz.cy, buffer);
// paintcount++; /* removing this line helped */
return;
}
|
Well, this piece of code is sort of optimization - if particular Image is painted only once, it is not transfered to BITMAP and painted directly ('SetSurface'). If painted for the second time, it gets coverted to BITMAP and painted that way, as we supposed that BITMAP is faster for repeated paints.
By removing the line, you force U++ to paint it always directly.
So, the first estimate is that Image is misclassified. Where is Image coming from? Is it .iml file, or is it something synthetised?
All in all, testcase would be fine...
Mirek
|
|
|
|
|
Re: Appearance problem in TabCtrl [message #32586 is a reply to message #32549] |
Thu, 26 May 2011 10:05   |
qapko
Messages: 55 Registered: October 2007 Location: Slovakia
|
Member |
|
|
Hello Mirek,
I think I have a simple fix for the problem.I've attached changed ImageWin32.cpp.
On line 251 I've changed
sd.hbmp = ::CreateCompatibleBitmap(dc, sz.cx, sz.cy);
to
sd.hbmp = ::CreateCompatibleBitmap(dcMem, sz.cx, sz.cy);
At http://msdn.microsoft.com/en-us/library/dd183488%28v=vs.85%2 9.aspx it is written that:
If a DIB section, which is a bitmap created by the CreateDIBSection function, is selected into the device context identified by the hdc parameter, CreateCompatibleBitmap creates a DIB section.
I have no skill with Windows API at all, so my question is: Can this really be the issue? And if it is, aren't there in the code of Ultimate++ any other places with the same problem?
Gabi
[Updated on: Thu, 26 May 2011 13:11] Report message to a moderator
|
|
|
Re: Appearance problem in TabCtrl [message #32633 is a reply to message #32586] |
Mon, 30 May 2011 11:54   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
qapko wrote on Thu, 26 May 2011 04:05 | Hello Mirek,
I think I have a simple fix for the problem.I've attached changed ImageWin32.cpp.
On line 251 I've changed
sd.hbmp = ::CreateCompatibleBitmap(dc, sz.cx, sz.cy);
to
sd.hbmp = ::CreateCompatibleBitmap(dcMem, sz.cx, sz.cy);
At http://msdn.microsoft.com/en-us/library/dd183488%28v=vs.85%2 9.aspx it is written that:
If a DIB section, which is a bitmap created by the CreateDIBSection function, is selected into the device context identified by the hdc parameter, CreateCompatibleBitmap creates a DIB section.
I have no skill with Windows API at all, so my question is: Can this really be the issue? And if it is, aren't there in the code of Ultimate++ any other places with the same problem?
Gabi
|
Well, if I am not mistaken, such a change would mean "deoptimalisation". What we want to get there is not a DIB section. DIB section is only used to transfer the data, but in resulting bitmap, we definitely want to have device dependent bitmap here.
Would it be at least possible to post .iml file here?
What about color depth in affected computer? That could easily be the difference....
Mirek
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 08:38:25 CEST 2025
Total time taken to generate the page: 0.00516 seconds
|
|
|