Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using TCanvas

Posted on 1998-05-30
1
Medium Priority
?
343 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 300 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

824 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