Solved

Using TCanvas

Posted on 1998-05-30
1
327 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Suggested Courses
Course of the Month10 days, 7 hours left to enroll

632 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