Board index » cppbuilder » Virtual Image Window

Virtual Image Window

I am wanting to show a "window" into an image. The actual bitmap is a larget 2000x2000 image and I am wanting to display
a 256x256 portion of it. I want to "pan and tilt" though the large image with the 256x256 bitmap window. Is there a way to do this
quickly. I know how to manipulate individual pixels in a Bitmap Control but was hoping for a quicker method of loading
up new data as I pan around the image.

I would appreciate any help....
Joel

 

Re:Virtual Image Window


void __fastcall CopyRect(const Windows::TRect &Dest, TCanvas* Canvas, const
Windows::TRect &Source);

Use CopyRect to transfer part of the image on another canvas to the image of
the TCanvas object. Dest specifies the rectangle on the canvas where the
source image will be copied. The Canvas parameter specifies the canvas with
the source image. Source specifies a rectangle bounding the portion of the
source canvas that will be copied.

The portion of the source canvas is copied using the mode specified by
CopyMode.

TBitmap has a TCanvas as one if its properties.

Re:Virtual Image Window


Quote
> a 256x256 portion of it. I want to "pan and tilt" though the large image

If you drop a TImage into a TScrollBox, set the TImage to have AutoSize on
and its top, left to be 0,0, you're all set.

+=====================================================+
| Jonathan Arnold (mailto:jdarn...@buddydog.org)      |
|         Comprehensive C++Builder link site:         |
| http://www.buddydog.org/C++Builder/c++builder.html  |
+=====================================================+

Re:Virtual Image Window


-----------------------------------------------------------------------
This solution is brought to you by Joe Hecht's TExcellent products,
solving Form.Print and bitmap printing problems. Joe Hecht's TExcellent
products can be found at: www.code4sale.com/joehecht/index.htm
-----------------------------------------------------------------------

Its interesting to note that many machines will fail to create (or work
with)
a 2000x2000 pixel bitmap, so at best, you will need to use a huge DIB
that is not constructed by the system. To do this reliably, you will need to
copy chunks from the huge bitmap to something that the VCL and/or
Windows can reliably work with without using Windows or VCL functions.

If you need a huge DIB library that can do this (and more), I have one.
Perhaps we can work out something to get the source into your hands.
Email me privatly if you are interested.

Joe

Quote
"Joel" <Joel.han...@alphabetatech.com> wrote in message

news:3a6894d8$1_1@dnews...
Quote

> I am wanting to show a "window" into an image. The actual bitmap is a

larget 2000x2000 image and I am wanting to display
Quote
> a 256x256 portion of it. I want to "pan and tilt" though the large image

with the 256x256 bitmap window. Is there a way to do this
Quote
> quickly. I know how to manipulate individual pixels in a Bitmap Control

but was hoping for a quicker method of loading
Quote
> up new data as I pan around the image.

Other Threads