Solved

Using TCanvas

Posted on 1998-05-30
1
316 Views
Last Modified: 2010-04-06
I have a bitmap that I load from a file and put into an integer array. To do this I draw the bitmap onto a canvas and then uses the canvas' pixels property to get the pixels into the array. The problem is it won't work if the canvas isn't a part of a VCL. When I made a variable of type TCanvas, and tried to draw the bitmap onto it I got a error message saying something like "Canvas does not allow drawing!". Everything worked fine when I drew onto the canvas of a TImage. What am I doing wrong? Is there a better way to do this without using the canvas?
0
Comment
Question by:red_2
1 Comment
 
LVL 3

Accepted Solution

by:
Matvey earned 100 total points
ID: 1349354
If you make an object variable you have to create it using TCanvas.Create, and assign it's parent. Are you sure that this is what you're doing?

Ahhh, wait... you can't create just canvas and draw on it - canvas represent something the user can see!! You have to use TBitmap for that or something like that...

You shouldn't use TCanvas like that - I'm sure.

Good luck!
Matvey
bosism@netvision.net.il
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 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