Solved

Saving TImages to memory

Posted on 2002-06-07
6
156 Views
Last Modified: 2010-04-04
I have a TImage on my form. How do i save the TImage to the memory and then draw it directly from the memory to the form at the co-ordinates I want it at? (i.e. like the QBASIC Get() and Put() functions).
0
Comment
Question by:tim_nash
  • 3
  • 2
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7061553
? just store it in the needed imageobject
(TBitmap for a bitmap for example)

use the bitblt-api to draw the image where you want
0
 

Author Comment

by:tim_nash
ID: 7061604
The image is a JPEG TImage. What would the code to do this be please (I am a newbie and am not sure how to work these things). I need two pieces of code:
1 piece Stores the image in the memory
1 piece draws the image from the memory to the correct co-ordinates
0
 

Accepted Solution

by:
Stormmin66 earned 75 total points
ID: 7062236
add JPEG to uses

MyJPeg: TJPegImage;

MyJPeg := Image1.Picture.Graphic; // Load image
Form1.Canvas.Draw( 100, 0, MyJPeg ); // Draw image
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Expert Comment

by:Stormmin66
ID: 7062250
could just save as bitmap as well, really doesn't matter, using TBitMap instead of TJPegImage.
0
 

Expert Comment

by:Stormmin66
ID: 7062254
sorry bout above mees up.

should be MyJPeg := TJPegImage.Create;
MyJPeg.Assign( Image1.Picture.Graphic );
0
 

Author Comment

by:tim_nash
ID: 7062780
Perfect. The code I was planning on using was kinda fifty lines long whereas this is really easy to use as WELL as short. Thanx to stormmin66. Definately recommended.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now