Solved

Saving TImages to memory

Posted on 2002-06-07
6
158 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
calling procedure inside activexForm from secondform 1 248
proper way to parse text with delphi 7 119
Convert a string into a TDateTime 5 60
Create a path if not exists 7 76
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

815 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

11 Experts available now in Live!

Get 1:1 Help Now