Solved

Using TCanvas

Posted on 1998-05-30
1
309 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
IExtractImage Delphi 14 162
FMX enumerated colours 2 70
find a node in VST 2 46
Making delphi communicate with a c# service 16 69
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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

14 Experts available now in Live!

Get 1:1 Help Now