|
-
Aug 13th, 2010, 02:54 PM
#1
[RESOLVED] Offsetting a HatchBrush
Hi,
This is a followup to this thread, where I'm trying to draw two sets of dots using HatchBrushes to create VS2010-like interface.
If you take a look at the zoomed image of the IDE background (blue with dark and light blue dots): that is what I'm trying to draw using GDI+.
In the previous thread ForumAccount helped me find the correct HashStyle to use (Percent20), but there is a problem: I need to draw two sets of these hatchstyles: once with a slightly darker color and once with a slightly lighter color, at an offset of one pixel downwards.
Well, no problem I thought, I'll just transform the graphics object (TranslateTransform) one pixel down before drawing the second set of dots.
But nope, that doesn't work. It seems the HatchBrush doesn't care what orientation the axis of the Graphics object are at (even rotated, scaled in one direction, or as I need: translated), the dots are always drawn in the exact same way, at the exact same spot.
This is a serious problem, because now I don't know of any way to offset the second set of dots... Is this even possible at all? I tried googling, but I got two results for WPF, and the third result was my own post...
This must be possible without having to draw them all manually? I don't fancy doing that, that would probably be extremely slow.
Is there perhaps some way to define my own hatch style and use that?
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
|