Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Saving Pointers To Fies

Posted on 1998-10-22
3
Medium Priority
?
151 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 400 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

636 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