delphi-xe2

Why the transparency of a PNG image is lost when I use TPicture?

99封情书 提交于 2019-12-11 07:49:30
问题 I'm using this code to convert a transparent png to a 32 bpp bmp. var Picture : TPicture; BMP : TBitmap; begin Picture := TPicture.Create; try Picture.LoadFromFile('Foo.png'); BMP := TBitmap.Create; try BMP.PixelFormat:=pf32bit; BMP.Width := Picture.Width; BMP.Height := Picture.Height; BMP.Canvas.Draw(0, 0, Picture.Graphic); BMP.SaveToFile('Foo.bmp'); finally BMP.Free; end; finally Picture.Free; end; end; The image is converted to bmp but the transparency is lost, what I'm missing? 回答1: Try

How to set value of Registry Key

☆樱花仙子☆ 提交于 2019-12-11 07:35:49
问题 I am having one Delphi XE2 project to write something in registry key. So I have defined the following codes : procedure TMainForm.BitBtn01Click(Sender: TObject); var RegistryEntry: TRegistry; begin RegistryEntry:= TRegistry.Create(KEY_READ); RegistryEntry.RootKey:= HKEY_LOCAL_MACHINE; if (not RegistryEntry.KeyExists('Software\MyCompanyName\MyName\')) then begin RegistryEntry.Access:= KEY_WRITE; RegistryEntry.OpenKey('Software\MyCompanyName\MyName\',True); end; RegistryEntry.CloseKey();

How to know all the conditional defines in a project

我只是一个虾纸丫 提交于 2019-12-11 07:28:10
问题 How it is possible to see all the conditional defines for a Delphi project? I can define something in project options, but there are some "defaults" and I don't know where to look for. Can you help? 回答1: Here are the sources of conditional definitions that I can think of: The pre-defined conditionals. The conditionals specified in the project options. The conditionals specified at the command line. The conditionals specified in the source code (often in .inc files). Now, I think you are

SQLite Exception raised with message: no such table

喜夏-厌秋 提交于 2019-12-11 07:04:27
问题 I created an application that collects information from the computer (computer name, CPU, Memory, etc) but I am having such a hard time displaying the information stored in the SQLite database, when I execute a query I get the “NO SUCH TABLE” message when I know for sure I have a table called “hardware” what am I doing wrong? Here the code I use to execute the query: procedure TMain.executeButtonClick(Sender: TObject); var results: TDataSet; query: String; begin outputMemo.ClearSelection;

Setup an ODBC connection to a MS Access DB under Data Explorer in XE2 Enterprise that does not use a DSN

跟風遠走 提交于 2019-12-11 06:30:26
问题 Using the Enterprise version of XE2, which includes native dbExpress ODBC support, I have successfully created a "Connection" where the Database Name is the name of the System DSN, and the Password is the MS Access database password. I can click Test Connection on the Modify Connection page, and the Database Explorer reports Test connection succeeded. Dragging and dropping the connection from the Data Explorer creates a TSQLConnection with the Driver property set to ODBC and the Params

order List with criteria choose to runtime

纵然是瞬间 提交于 2019-12-11 05:57:49
问题 if i have a generics list with more field for example: PMyList = record Field1, Field2, ... FieldN : Integer; end; TMyList = List<PMyList>; For order the list with criteria choose to runtime (for example: field2 then field2, or: field3 then field1 then field2 etc) there is some solution or i need to do a compare construct for all combination possibile of order that i want? Mine idea was, if record is N field, i have thinked to a array so defined: MyArray = array [1..n] of Integer; and assign

How to return Oracle Cursor from stored proc as Client Dataset using Delphi and DBExpress

天涯浪子 提交于 2019-12-11 04:35:17
问题 1st off I am Still a little green to Delphi so this might be a "mundane detail" that's being over looked. [sorry in advance] I have a need to create a TSQLDataset or TClientDataSet from an Oracle 11g cursor contained in a package. I am using Delphi XE2 and DBExpress to connect to the DB and DataSnap to send the data back to the client. I'm having problems executing the stored procedure from the Delphi code. Package Head : create or replace PACKAGE KP_DATASNAPTEST AS procedure GetFaxData(abbr

How to determine using Rtti, if a field from a class is a Record

旧街凉风 提交于 2019-12-11 04:03:22
问题 I coded a RttiHelper class, that among other things, can retrieve all field's names of a class. The procedure succesfully determines if a field is an object or an array, but it cannot determine if a field is a Record. Follows code: unit Form1 interface uses RttiHelper; type tMyRec = Record ... end; ... implementation var MyRec : tMyRec; procedure FormCreate (Sender: tObject); begin SetRec (@MyRec); end; unit RttiHelper interface type tObjRec = class Rec : Pointer; end; ... tRttiHelperClass =

Delphi XE3, ugly StringGrid's borders

…衆ロ難τιáo~ 提交于 2019-12-11 02:38:30
问题 Why StringGrid's borders are so unclear in XE3, comparing to Delphi7? How to fix that? 回答1: After Delphi 2010 all the Grids are themed. To disable the new theme on a grid you have to set the property DrawingStyle to gdsClassic in the objects inspector. 来源: https://stackoverflow.com/questions/12996363/delphi-xe3-ugly-stringgrids-borders

It is possible to use the EWS Managed API from a Delphi Win32 VCL app (and how to start)?

为君一笑 提交于 2019-12-11 02:17:18
问题 I'm currently investigating accessing Exchange Web Services (EWS) through SOAP (see e.g. this prior question), but there also is a recommended EWS Managed API. Would it be possible to use that API from a Win32 Delphi-XE2 app? I see people using the API from e.g. PHP with tools like PHP-EWS so it looks possible from other languages than C#, but where would I start using Delphi? 来源: https://stackoverflow.com/questions/13084508/it-is-possible-to-use-the-ews-managed-api-from-a-delphi-win32-vcl