Solved

Delphi Tbitmap

Posted on 2003-11-04
8
1,702 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
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!

 
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

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!

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

740 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