473,804 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "invalidate d" 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 1626
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*****@domain less.com> wrote in message
news:3s******** ************@sp eakeasy.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 "invalidate d" 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*****@nowher e.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.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*****@domain less.com> wrote in message
news:3s******** ************@sp eakeasy.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 "invalidate d" 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
2799
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 lead to another question, need to know what would be the last question before the scroll bar would appear. Thanks, JSP.
3
16542
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 ideas would be most appreciated.
8
5127
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 an height of 100% and an width of 100%. As soon as the content of one cell is too big for the table I want the browser to show a scrollbar in this cell. I'm sure that this is possible with CSS (overflow:auto?), but I couldn't find the solution so...
13
16550
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 the calculator back with a "onMouseup()" which I thoguht would activate when the scroll bar was released but it doesn't. What I really want is an "offScroll()" but there is no such thing! ...
5
3693
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 think of, but just can't get it to display quite right. It's worth noting that the page displays exactly as intended in Firefox. First Problem:
2
2097
by: AzGhanv/. | last post by:
Hi, I want to do scrolling like done in google books (acrobat reader style) http://books.google.com/books?vid=ISBN0871699265&id=PS0LAAAAIAAJ&pg=PA1&lpg=PA1&ots=M9nL5VPSnM&dq=free+book&sig=y4Ai0dKRuW_fGvO7VKdoRrLLsJQ it could be done by scrollTop & scrollLeft ... but how to get exact effect like in acrobat reader. Thanks.
6
10710
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 = m_vScrollBar.Maximum; The scroll bar is set to start from the bottom.
0
1481
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 (each of type UserControl), and a hScrollBar object. I will add further objects to my control as time progresses. My main control will not be scrollable. I have set the width of the plot controls to be equivalent in pixels to what the audio file...
6
4617
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 bars. However, when I tried to add any doctype at all (HTML strict, HTML loose, XHTML transitional, XHTML strict, etc.), it stopped working. Do I have any control over IE's scroll bars when using doctypes?
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10353
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10356
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10099
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.