Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Save from memory to file

Posted on 1997-08-05
6
Medium Priority
?
205 Views
Last Modified: 2010-04-16
Hya there, i made this cool drawing program, the drawing is showen on
like a bar(100,100,400,400) and i wanted to know how i can save the drawing to a file. im using the graph unit. all i know is how to save to the memory using getimage, and to load it using putimage, but how can i
save it to a FILE and then to load it?
0
Comment
Question by:yolis
[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
  • 4
  • 2
6 Comments
 

Author Comment

by:yolis
ID: 1215386
Edited text of question
0
 

Accepted Solution

by:
harisis earned 240 total points
ID: 1215387
It is very simple. Just create a file of your buffer that you use with  getimage. For example:

type  
  buffer=array[1..9000] of byte;
var
  b1:buffer;
  f1:file of buffer;
begin
 getimage(100,100,400,400,buffer );
 asign(f1,'myfile.xxx');
 rewrite(f1);
 write(f1,b1);
 close(f1)
end;

 With the procedure "read(f1,b1)" instead of the "write" you can load the buffer from the file and then put it on the screen. Of course in this case you must "reset" the file instead of "rewrite" it.
0
 

Author Comment

by:yolis
ID: 1215388
its not working!!

to use getimage, i must use the command getmem, and to use getmem i need to give it a variable of pointer..,
so.. what to do?

0
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 

Author Comment

by:yolis
ID: 1215389
its nor working!, i need to use getmem
and getmem only works with pointers!

0
 

Expert Comment

by:harisis
ID: 1215390
First, you don't need to use getmem with the getimage. You can use a simple variable as a buffer as i show you in the example (but of cource the size of the variable must be aproptiate).

Second, if you want to use a pointer as a buffer (and use the getmem to hold the memory for the pointer) a little changes in the example i gave you. You will add the commands for the pointer (getmem e.t.c.) and change the command "write" as follows:

 write(f1,p^)

where p is the pointer you used with getmem.

p.s. Thanks for the points. I 'll try to help you till the end.
0
 

Author Comment

by:yolis
ID: 1215391
Alright!!, it works!!!, Thaaank you!, i would give you more points if i could.. :)

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

While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
Considering cloud tradeoffs and determining the right mix for your organization.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

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