Solved

Using TCanvas

Posted on 1998-05-30
1
312 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn 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…
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 is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

948 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

21 Experts available now in Live!

Get 1:1 Help Now