473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Manual scroll rendering

I need to scroll a virtual grid that is 1.2M pixels x 1.28M pixels in size.
I think this is too large of a size for a control or a form, so I think I
need to "fake it" with a custom drawn control.

I do not need to maintain a bitmap or make the control surface physically
larger than the screen, becuase I can create the grid dynamically based upon
any virtual X, Y upper-left coordinate of the currently viewed area. E.g.,
if I am scrolled to X=82503 and Y=53301, I can pain what the grid would
theoretically look like at this position, without having to actually
maintain a grid that is actually that large.

Because I won't be working with a control that is bigger than the
screen/form, I have placed v&h scrollbar controls on my control, and
OnScroll I invalidate the newly scrolled area to trigger OnPaint (modeled
loosely after observing autoscroll's invalidation behavior).

But my problem with the painting is not the new, invalidated area; it's
"shifting" the non-invalidated, already-drawn portion without having to
repaint the whole thing from scratch. I don't know how to do this part - I
think I want to perform a Transform? But it seems rather complex (I don't
really understand the matrix object!)

If I click my vertical scroll bar and the thumb moves 10 pixels "down", in
response to this OnPaint I need to "shift" the currently painted scene up
10px, thus exposing an "invalidated" 10px area at the bottom. I can draw
this new 10px portion just fine, but... how do I perform this "shift" of the
previously painted area? When I used to rely on autoscroll to invalidate
for me, I only had to worry about painting the newly invalidated area and
the "shift" happened automatically (and smoothly) and now without the
benefit of autoscroll I want to reproduce that manually.
Nov 21 '05 #1
2 1613
Try using ScrollWindow.

Private Declare Function ScrollWindow Lib "user32.dll" (ByVal hWnd As Int32,
ByVal XAmount As Int32, ByVal YAmount As Int32, ByRef lpRect As RECT, ByRef
lpClipRect As RECT) As Int32
"Workgroups" <no*****@domainless.com> wrote in message
news:3s********************@speakeasy.net...
I need to scroll a virtual grid that is 1.2M pixels x 1.28M pixels in size.
I think this is too large of a size for a control or a form, so I think I
need to "fake it" with a custom drawn control.

I do not need to maintain a bitmap or make the control surface physically
larger than the screen, becuase I can create the grid dynamically based
upon any virtual X, Y upper-left coordinate of the currently viewed area.
E.g., if I am scrolled to X=82503 and Y=53301, I can pain what the grid
would theoretically look like at this position, without having to actually
maintain a grid that is actually that large.

Because I won't be working with a control that is bigger than the
screen/form, I have placed v&h scrollbar controls on my control, and
OnScroll I invalidate the newly scrolled area to trigger OnPaint (modeled
loosely after observing autoscroll's invalidation behavior).

But my problem with the painting is not the new, invalidated area; it's
"shifting" the non-invalidated, already-drawn portion without having to
repaint the whole thing from scratch. I don't know how to do this part -
I think I want to perform a Transform? But it seems rather complex (I
don't really understand the matrix object!)

If I click my vertical scroll bar and the thumb moves 10 pixels "down", in
response to this OnPaint I need to "shift" the currently painted scene up
10px, thus exposing an "invalidated" 10px area at the bottom. I can draw
this new 10px portion just fine, but... how do I perform this "shift" of
the previously painted area? When I used to rely on autoscroll to
invalidate for me, I only had to worry about painting the newly
invalidated area and the "shift" happened automatically (and smoothly) and
now without the benefit of autoscroll I want to reproduce that manually.

Nov 21 '05 #2
Yes that does the trick. Thanks for your help.

"Some Guy" <no*****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Try using ScrollWindow.

Private Declare Function ScrollWindow Lib "user32.dll" (ByVal hWnd As
Int32, ByVal XAmount As Int32, ByVal YAmount As Int32, ByRef lpRect As
RECT, ByRef lpClipRect As RECT) As Int32
"Workgroups" <no*****@domainless.com> wrote in message
news:3s********************@speakeasy.net...
I need to scroll a virtual grid that is 1.2M pixels x 1.28M pixels in
size. I think this is too large of a size for a control or a form, so I
think I need to "fake it" with a custom drawn control.

I do not need to maintain a bitmap or make the control surface physically
larger than the screen, becuase I can create the grid dynamically based
upon any virtual X, Y upper-left coordinate of the currently viewed area.
E.g., if I am scrolled to X=82503 and Y=53301, I can pain what the grid
would theoretically look like at this position, without having to
actually maintain a grid that is actually that large.

Because I won't be working with a control that is bigger than the
screen/form, I have placed v&h scrollbar controls on my control, and
OnScroll I invalidate the newly scrolled area to trigger OnPaint (modeled
loosely after observing autoscroll's invalidation behavior).

But my problem with the painting is not the new, invalidated area; it's
"shifting" the non-invalidated, already-drawn portion without having to
repaint the whole thing from scratch. I don't know how to do this part -
I think I want to perform a Transform? But it seems rather complex (I
don't really understand the matrix object!)

If I click my vertical scroll bar and the thumb moves 10 pixels "down",
in response to this OnPaint I need to "shift" the currently painted scene
up 10px, thus exposing an "invalidated" 10px area at the bottom. I can
draw this new 10px portion just fine, but... how do I perform this
"shift" of the previously painted area? When I used to rely on
autoscroll to invalidate for me, I only had to worry about painting the
newly invalidated area and the "shift" happened automatically (and
smoothly) and now without the benefit of autoscroll I want to reproduce
that manually.


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JSP | last post by:
Hi There, I was wondering if there is anyway to capture an event for when the scroll bar would appear while rendering a page with dymanic results driven questions. Such that answer to q1 would...
3
by: David Rwj Cherry CS2000 | last post by:
is there any way to disable or lock vertical scroll bars on a browser window? im a newbie and i just don't want them to appear on my screen. sometimes they appear on IE but not on mozilla. any...
8
by: Manuel Reimer | last post by:
Hello, I have the following problem: I have a table on my homepage which has two cells. One cell left which has the menu in it and one on the right where I display the content. This table has...
13
by: Simon Wigzell | last post by:
Can I trap when the scroll is ended? This is what I want - the calculator disapears when the site visitor starts scrolling the main page. I'm doing that with an "onScroll()" function. I'm bringing...
5
by: Aidan | last post by:
Greetings all, I'm trying to build a div based layout for a mambo template (work in progress), and I'm having a strange problem, 2 acctually, with scroll bars in IE. I've tried everything I can...
2
by: AzGhanv/. | last post by:
Hi, I want to do scrolling like done in google books (acrobat reader style) ...
6
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I'm using the VScrollBar and set it as follow: m_vScrollBar.Minimum = -19602; m_vScrollBar.Maximum = 0; m_vScrollBar.SmallChange = 1; m_vScrollBar.LargeChange = 1089; m_vScrollBar.Value =...
0
by: bg_ie | last post by:
Hi, I wish to create my own control (of type UserControl) which will show audio data. In this control I have place 3 things, 2 objects that represent audio plots for both left and right channels...
6
by: bgold12 | last post by:
I was using quirks mode (without a doctype) and set the overflow CSS property to :auto for the body tag like so: <body style="overflow:auto"> And it worked; it got rid of IE's default scroll...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.