Thread: Bitmap scroll issues

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    36

    Bitmap scroll issues

    I read up on msdn's scrolling example and I applied it to a large bitmap. I made it just about equal to msdn's example and it works, but not quite right.

    I start my app with a small portion of the bitmap visible, and I can scroll up and down just fine; to the end and back with no issues. When I resize the window to view more of the image though, things go wrong.

    Say, when the horizontal scroll bar is in its startup position at the far left, resizing the window works as normal (resizing beyond bitmap area gets black like I want), but when the bar is changed, resizing the window has very strange effects. If I resize it beyond the width of the bitmap, the image either gets warped, or other pieces of he bitmap show up, rather than just being black.

    I ask if there's antoher write up on the scrolling funcutionality or if there's a common problem I have.

    Thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    You should regard the samples on MSDN as example proof of concept implementations, not bullet-proof solutions you can use in any circumstance.

    Sounds like you need to trap some of the resize/scroll messages and make appropriate adjustments to your coordinate data before redrawing.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    36
    This stuff is extremely confusing...I'd like to make the window so it cannot be resized beyond the dimensions of the bitmap but WM_SIZE gets processed even if I return from it. I want it to be unresizeable from the moment it hits the bitmaps dimensions or when the maxmize button is hit I want it to expand to the dimensions of the bitmap.

    I can't find a WM_MAXIMIZE so I'm not sure where to look for that.

  4. #4
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,273
    Have a look at the WM_GETMINMAXINFO message instead.

  5. #5
    Registered User
    Join Date
    Jun 2006
    Posts
    36
    Thanks, looks like what I'm after.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Odd Sizing Issues
    By Gerread in forum Windows Programming
    Replies: 4
    Last Post: 06-01-2007, 08:38 PM
  2. OpenGL -- Bitmaps
    By HQSneaker in forum Game Programming
    Replies: 14
    Last Post: 09-06-2004, 04:04 PM
  3. Bitmap with a scroll bar
    By SuperNewbie in forum Windows Programming
    Replies: 1
    Last Post: 10-29-2003, 11:36 PM
  4. Bitmap scrolling with scroll bars
    By solar3147 in forum Windows Programming
    Replies: 0
    Last Post: 03-17-2003, 02:39 AM
  5. bitmap not going onto screen
    By stallion in forum Windows Programming
    Replies: 4
    Last Post: 02-22-2003, 10:07 AM