Solved

Delphi Tbitmap

Posted on 2003-11-04
8
1,697 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
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dev Express grid collapse 2 45
TEMBEDDEDWB how can i change its user agent ? 8 70
scroll down TListBox component in Delphi 1 19
firemonkey Android Listview Sort items 7 55
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

821 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