Solved

Delphi Tbitmap

Posted on 2003-11-04
8
1,705 Views
Last Modified: 2010-01-26
I'm creating a TBitmap var Bitmap: TBitmap; begin Bitmap : =TBitmap.Create; the problem is that here I get a compiler error of 'Object or class type required'. Any ideas why?
0
Comment
Question by:LeningYang
[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
8 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 63 total points
ID: 9678199
??

thats ok:

procedure TForm1.Button1Click(Sender: TObject);
var Bitmap: TBitmap;
begin
  Bitmap :=TBitmap.Create;
  ...
end;

the problem must be on another point

meikl ;-)
0
 
LVL 25

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 62 total points
ID: 9678430
Include Graphics in the uses section or make sure that it is included.

Regards,
  Tomas Helgi
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9678446
yep, thats it, thomas
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:j42
ID: 9679972
There are two types of TBitmap. One is a class (in Graphics.pas) the other is just a record (maybe in Windows.pas). It depends on your uses list which one will be used. You can always force Delphi to take the one you want by saying Graphics.TBitmap or Windows.TBitmap.
0
 

Expert Comment

by:sepknow
ID: 20633216
Init Delphi variables to prevent warning message.
0
 
LVL 2

Expert Comment

by:sdkswat
ID: 26412405
I had the same problem, j42 is definitely right. The order of user clause can cause this problem.
If you are working on a TBitmap like in a TImage object, You will have to add Windows unit before Graphics unit.

You have accepted the wrong answer mate. Answer of j42 was enough clear to solve this problem.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

707 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