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

x
?
Solved

Saving TImages to memory

Posted on 2002-06-07
6
Medium Priority
?
162 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
[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
  • 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 300 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

719 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