Solved

Saving Pointers To Fies

Posted on 1998-10-22
3
149 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

691 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