Picture Box Origin Shifting/Refresh problem (VB6)

rohit1979
08-19-2008, 09:20 AM
Hi,

I have shifted the origin of a picturebox and changed its extents using the following statements:

Call SetViewportOrgEx(PictureBox1.hDC,100, ViewExtY-100, ViewOrgOld)
Call SetMapMode(PictureBox1.hDC, MM_ANISOTROPIC)
Call SetWindowExtEx(PictureBox1.hDC, WinExtX, WinExtY, WinExtOld)
Call SetViewportExtEx(PictureBox1.hDC, ViewExtX, -ViewExtY, ViewExtOld)

where,
ViewExtX, ViewExtY are viewport (PictureBox) X and Y extents.
WinExtX, winExtY are Window X and Y extents


so that, the new origin is at (100,100) from the bottom left.

The problem is that when refreshing the picturebox (with new origin and extents) by .Refresh or .Cls, the part of the picturebox on the left and bottom of the new +ve axes is not refreshing. It looks as if -ve part is not getting painted.

I need the full picturebox to be refreshed.

Any help will be much appreciated.

Thanks,

Rohit

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum