Solved

Saving Pointers To Fies

Posted on 1998-10-22
3
143 Views
Last Modified: 2011-10-03
I'm working on a 3D Scrolling engine for pascal in which I am using the function Getimage to save portions of the screen to files.  The problem is when using a pointer, you are only saving the memory location of the image not what is actually at the pointer location.  I was wondering if anyone knew if and how this is can be accomplished.  I do not know assembly language and would appreciate an answer without it.
0
Comment
Question by:Corey080698
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
scrapdog earned 100 total points
ID: 1215844
Are you using Turbo Pascal?

You could do it this way:

Declare this variable:

var Image :Pointer;

And in your code:

Size := ImageSize(x1,y1,x2,y2);
GetMem(Image, Size);
GetImage(x1,y1,x2,y2,Image^);

{open your file here (a file of bytes)}

to write to the file:

BlockWrite(File, Image^, Size, Result);  {result returns number of bytes sent to file}


When you are done with the image buffer:

FreeMem(Image, Size);




0
 
LVL 2

Expert Comment

by:omsec
ID: 1215845
if you have a pointer variable it's always same :

Var
  Something : Pointer;

"Something" is the Pointer (xxxx:yyyy)
and
"Something^" is the Data where the Pointer points to
0
 

Author Comment

by:Corey080698
ID: 1215846
I tried the above answers, but neither of them are working...when i reload the image to a pointer variable from the file, its not coming acrossed as it was saved or not at all.  Any more sugestions?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In order to fulfill our mission of inspiring learning in the technology community, Experts Exchange is launching a Course of the Month program. Premium and Team Account members will have access to one course per month as a part of their membership, …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question