Board index » delphi » GETIMAGE Not Working

GETIMAGE Not Working

I'm using Borland Turbo Pascal v.6.0. I'm writting a GUI windows system. The
user can define windows, titles and command buttons. When a window is drawn
overtop another window, I want to use GETIMAGE to store the area that will be
covered by the new window.

The simplified code looks like this:

var Window : array [1 .. 10] of record {10 maximum number of windows}

                x : integer; {left side of window}
                y : integer; {top side of window}
                x2 : integer; {right side of window}
                y2 : integer; {bottom of window}      
                P : pointer; {points to area of memory where GETPICTURE will
store the image}

                end;

I use GETIMAGE (x,y,x2,y2,Window[some_window].P^) However, this causes an
error every time. In fact, it actually crashes the program! I've tried it both
using a pointer in the Window[] array, and just a regular variable, but that
didn't work either. Does anyone know what causes this and how to fix it?

(Or a different way to store the area underneath another window?)

 

Re:GETIMAGE Not Working


Well, I can't find anything wrong about it... but are sure not to be
breaking the 64k-border? I mean, with ONE pointer you can maximally store
64k image data (in 8-bit color mode, this would be about  320x200 (a bit
more, indeed)). If you want to store areas eating more than 64k, you have
to split it in several 64k-parts. That's all I can actually say about it.
Think about it - maybe the covered areas are just breaking the border! Hope
it helps!

CU

Re:GETIMAGE Not Working


Transactoid schrieb in Nachricht <7nng4j$62...@news2.tor.accglobal.net>...

Quote
>I'm using Borland Turbo Pascal v.6.0. I'm writting a GUI windows system. The
>user can define windows, titles and command buttons. When a window is drawn
>overtop another window, I want to use GETIMAGE to store the area that will be
>covered by the new window.
>The simplified code looks like this:
>[...]
>I use GETIMAGE (x,y,x2,y2,Window[some_window].P^) However, this causes an
>error every time. In fact, it actually crashes the program! I've tried it both
>using a pointer in the Window[] array, and just a regular variable, but that
>didn't work either. Does anyone know what causes this and how to fix it?

Have you Newed or GetMemed the pointer Window[some_window].P?

--
  If you speak German, please visit my homepage (there you will find two
  pictures of my voxel project, too):
     http://home.t-online.de/home/Matthias.Buechse/

  If you want to see the pictures though and me to create an English home-
  page, vote for it at:
     Matthias.Buec...@T-Online.de

Re:GETIMAGE Not Working


In article <7nng4j$62...@news2.tor.accglobal.net>,

Quote
Transactoid <transact...@hotmail.com> wrote:
>I'm using Borland Turbo Pascal v.6.0. I'm writting a GUI windows system. The
>user can define windows, titles and command buttons. When a window is drawn
>overtop another window, I want to use GETIMAGE to store the area that will be
>covered by the new window.

>The simplified code looks like this:

>var Window : array [1 .. 10] of record {10 maximum number of windows}

>                x : integer; {left side of window}
>                y : integer; {top side of window}
>                x2 : integer; {right side of window}
>                y2 : integer; {bottom of window}      
>                P : pointer; {points to area of memory where GETPICTURE will
>store the image}

>                end;

>I use GETIMAGE (x,y,x2,y2,Window[some_window].P^) However, this causes an
>error every time. In fact, it actually crashes the program! I've tried it both
>using a pointer in the Window[] array, and just a regular variable, but that
>didn't work either. Does anyone know what causes this and how to fix it?

Did you allocate the memory for the buffers? Your simplified code is
next to  useless in describing the problem. Please post a minimum
program that produces the error.

Osmo

Other Threads