Link to home
Start Free TrialLog in
Avatar of studebaker
studebaker

asked on

1 pixel wide Brush ?

Hi,
My program's view is based on the CZoomView by Brad Pirtle(codeguru.com Doc-View catagory), which is derieved from CSrollView.

I used the SelectStockObject(BLACK_PEN) to do most of my drawing, so when I zoom in and out the lines stay a the same thickness(1 pixel), this works great.

The problem is when certain items are selected they are redrawn using a brush similar to the PS_ALTERNATE pen in NT (Drawing dotted lines - Jean-Edouard Lachand-Robert/GDI catagory). This works great when you stay in the default zoom mode, but when you zoom in/out the lines really look bad. Sometimes some lines are thicker than others.

What I would like to do is keep them(the dotted lines) at the same 1 pixel width regaurdless of how far in/out you zoom.

I also implement the DrawDragRect, which as you might guessed works great in the default mode. When I zoom in/out things get crazy, it does not redraw it's self correctly. I've testet the CRectTracker which uses the DrawDragRect and it works fine at any zoom. When I call the DrawDragRect I pass it a CSize(1,1) like CRectTracker.

Can anybody help? I'm really stuck :(

Mark

ASKER CERTIFIED SOLUTION
Avatar of scs1
scs1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial