Solved

How can I get an Image from a Canvas at runtime....

Posted on 2011-09-20
1
381 Views
Last Modified: 2016-09-30
Hi all,

I have a Delphi application where I do the following:

1. Create a TImage at runtime.
2. Draw dynamically (using StretchDraw) onto the Canvas
3. Display this on a form

This works fine.

I now want to replace a specific colour on the TImage with another one.
I have aroutine that takes a TBitmap and performs the colour replacement, however it does not appear to work with what I am doing above!

The parameter I am calling the function with is "MyTImage.Picture.Bitmap"
I assume this is not the correct paramater to get the modified Canvas

Any ideas what I am doing wrong here?

Thanks,

James

0
Comment
Question by:jatkin
1 Comment
 
LVL 25

Accepted Solution

by:
epasquier earned 500 total points
Comment Utility
ok, not Update as it will not invalidate the Image, but MyImage.Repaint; (= Invalidate + Update )
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 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

9 Experts available now in Live!

Get 1:1 Help Now