It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Picture Box Origin Shifting/Refresh problem (VB6)

Moderator: dafunkymunky

Picture Box Origin Shifting/Refresh problem (VB6)

Postby rohit1979 on Fri Aug 22, 2008 4:26 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 dont want to refresh the picturebox by again setting origin back to (0,0) as it causes more flicker.

I need the full picturebox to be refreshed.

Any help will be much appreciated.

Thanks,

Rohit
rohit1979
 
Posts: 2
Joined: Fri Aug 22, 2008 4:21 am

Who is online

Users browsing this forum: No registered users and 2 guests