-
Oct 23rd, 2014, 05:48 AM
#1
Thread Starter
Lively Member
-
Oct 23rd, 2014, 07:16 AM
#2
Re: DrawText draws Segoe UI font texts with unremovable artifacts
Are the scrollbars created by your active X via CreateWindow APIs? Or does the window/uc create these automatically? Looks as though the view port device context (minus the scrollbars) may need to be clipped?
-
Oct 23rd, 2014, 07:47 AM
#3
Frenzied Member
Re: DrawText draws Segoe UI font texts with unremovable artifacts
You can use CreateRectRgn,GetClipRgn,SelectClipRgn,DeleteObject API to create clipregion to draw text or else to avoid beyond boundary.
-
Oct 23rd, 2014, 11:41 AM
#4
Re: DrawText draws Segoe UI font texts with unremovable artifacts
Wisecat, if you drag it off the screen and then back again, does it clear up the problem? If so, using a bit of the following should clear it up. (I'll let you rework that code, but it should be fairly obvious.) That'll tell Windows to redraw that portion of the screen.
Code:
Private Declare Function GetClientRect Lib "user32.dll" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function InvalidateRect Lib "user32.dll" (ByVal hWnd As Long, lpRect As RECT, ByVal bErase As Long) As Long
GetClientRect ctrl.hWnd, uRect
InvalidateRect ctrl.hWnd, uRect, 1&
EDIT: Ahhh, and here's your Rect UDT:
Code:
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
EDIT2: Also, where'd you put that code might be a bit tricky, possibly in whatever AddItem method you have for your control. Or, if the user can resize it, possibly in the resize event.
Last edited by Elroy; Oct 23rd, 2014 at 11:44 AM.
-
Oct 23rd, 2014, 11:45 AM
#5
Thread Starter
Lively Member
Re: DrawText draws Segoe UI font texts with unremovable artifacts
I've found the source of the problem - I did not calculate the client rectangle properly in some situations. My fault
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|