随笔分类 - DELPHI
摘要:http://sourceforge.net/projects/dxgettext/DescriptionGNU GetText translation tools for Borland Delphi and Borland C++ Builderhttp://downloads.sourceforge.net/project/dxgettext/For%20Delphi%20and%20C%2B%2B%20Builder/1.2.2/dxgettext-1.2.2.exeBugfixes and improvements to gnugettext.pasThese changes are
阅读全文
摘要:http://blog.dummzeuch.de/category/delphi/Samstag, Dezember 29th, 2012Some might know that I have been using and contributing to theGnuGetText for Delphi and C++ Builderproject. I just had another look into the gnugettext unit and found that it was rather difficult to understand the logic behind all
阅读全文
摘要:{$R filename}{$RESOURCE filename}{$R *.xxx}{$R 'My file'}.{$R filename.res filename.rc} The $R directive specifies the name of a resource file to be included in an application or library. The named file must be a Windows resource file and the default extension for filenames is .res. To speci
阅读全文
摘要:http://www.delphibasics.info/home/delphibasicssnippets/detectusbdeviceinsertandremoval-uusbbytestestunit uUsb;//Author: testestinterfaceuses Windows, Messages, Classes;type PDevBroadcastHdr = ^DEV_BROADCAST_HDR; DEV_BROADCAST_HDR = packed record dbch_size: DWORD; dbch_devicetype: DWORD; ...
阅读全文
摘要:TStream 是一个抽象的基类, 不能直接生成对象TStream -->THandleStream-->TFileStreamTStream -->TCustomMemoryStream --> TMemoryStreamTStream -->TCustomMemoryStream --> TResourceStreamTFileStream: 文件流TStringStream: 字符串流TMemoryStream: 内存流TResourceStream: 资源文件流TStream 有 Seek() 方法, 它的子类们(TFileStream、TMemor
阅读全文
摘要:http://www.codeguru.com/cpp/g-m/bitmap/specialeffects/article.php/c1725/Invert-mirror-a-bitmap.htmInvert (mirror) a bitmaphttp://www.efg2.com/Lab/ImageProcessing/RotateScanline.htmDiscussionIf one attempts to rotate a bitmap in the "forward" direction by selection Pixel (i, j) and rotating
阅读全文
摘要:使用Dephi进行图像处理可以有多种方法,最常用的应该算是TBitmap,它提供方便的图像存取能力,结合Canvas可进行画线、画圆、图像拷贝等操作。不过在进行大量的图像处理操作时,为了获得更高的速度,我们希望能够直接对图像缓冲区进行读写。查阅Dephi的帮助手册没有发现直接取得整个图像缓冲区的功能,但提供的ScanLine属性可以取得指定行图像数据的指针,比较接近我们的要求,先看看ScanLine的描述:propertyScanLine[Row: Integer]: Pointer;Provides indexed access to each line of pixels.ScanLine
阅读全文
摘要:Delphi有三种类型的字符:AnsiChar这是标准的1字节的ANSI字符,程序员都对它比较熟悉。WideChar这是2字节的Unicode字符。Char在目前相当于AnsiChar,但在Delphi 2010 以后版本中相当于WideChar.记住因为一个字符在长度上并不表示一个字节,所以不能在应用程序中对字符长度进行硬编码,而应该使用Sizeof()函数。注意Sizeof()标准函数返回类型或实例的字节长度。Delphi有下列几种不同的字符串类型 String:ShortString保留该类型是为了向后兼容 Delphi1.0,它的长度限制在255个字符内。 ShortString[0]
阅读全文
摘要:http://www.efg2.com/Lab/ImageProcessing/FlipReverseRotate.htmThe purpose of this program, FlipReverseRotate.EXE, is to demonstrate how to flip (top-to-bottom) and/or reverse (left-to-right) a bitmap in memory and display the results on the screen. Three methods to flip/reverse are compared: Scanline
阅读全文
摘要:{ Article: Most Recently Used (MRU) menu component - TMRU http://delphi.about.com/library/weekly/aa112503a.htm Full source code of a TMRU component, a non-visual component which simplifies implementing a "Most Recently Used" file list in a menu (or a popup menu). The TMRU component allows
阅读全文
摘要:http://delphi.about.com/library/weekly/aa100703a.htm{ Article: Controling the number of application instances http://delphi.about.com/library/weekly/aa100703a.htm In this article you'll learn how to "run-once enable" a Delphi application that can check for its previous (running) instan
阅读全文
摘要:http://delphi.about.com/od/windowsshellapi/a/clipboard_spy_3.htmDo you know that, for example, MS Word has it's own format for storing data to the clipboard? Large number of applications paste information in other formats, for example Rich Text Format, HTML format and so forth. Why not use Delph
阅读全文
摘要:unit uMultiInputBox;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Controls, Vcl.Forms, Vcl.StdCtrls;type TFieldType = ( ftNumber, ftHexNumber, ftFloatNumber, ftText ); TInputRec = record Prompt : string; MaxLength : integer; FieldTy...
阅读全文
摘要:This is the difference between a "procedure" and a "procedure of object"TheOnClickis defined as aTNotifyEvent:type TNotifyEvent = procedure(Sender: TObject) of object;You cannot assign a procedure to theOnClickas it is the wrong type. It needs to be a procedure of object.You can
阅读全文
摘要:procedure MoveMemory(Destination: Pointer; Source: Pointer; Length: NativeUInt);begin Move(Source^, Destination^, Length);end;procedure CopyMemory(Destination: Pointer; Source: Pointer; Length: NativeUInt);begin Move(Source^, Destination^, Length);end;procedure FillMemory(Destination: Pointer; Len..
阅读全文
摘要:指针 : 指针是一个特殊的变量, 它里面存储的数值被解释成为内存里的一个地址.(1) 指针对应着一个数据在内存中的地址, 得到了指针就可以自由地修改该数据. (2) 一个指针变量仅仅是存储一个内存的地址, 为指针所指向的内容分配空间是程序员要干的工作. (3) 如果一个指针没有指向任何数据, 它的值是nil, 它就被称为是零( nil )指针或空(null) 指针. (4) 要访问一个指针所指向的内容, 在指针变量名字的后面跟上^运算符. 这种方法称为对指针取内容. (5) 指针的指针就是用来存放指针所在的内存地址的. 要搞清一个指针, 需要了解以下内容:(1) 指针的类型. (2) 指针所.
阅读全文
摘要:fmOpenRead = $0000; fmOpenWrite = $0001; fmOpenReadWrite = $0002; fmExclusive = $0004; // when used with FileCreate, atomically creates the file only if it doesn't exist, fails otherwise fmShareCompat = $0000 platform; // DOS compatibility mode is not portable fmShareExclu...
阅读全文
摘要:Hex formatsIntel=====Hexadecimal values are always in uppercase. Each line is a record.The sum of all the bytes in each record should be 00 (modulo 256).Record types:00: data records01: end-of-file record02: extended address recordData record----------- :0D011C0000000000C3E0FF0000000000C30F: 0D 0...
阅读全文
摘要:var fullFileName : string;begin // Set up a full file name with drive and path fullFileName := 'C:\Program Files\Borland\Delphi7\Projects\Unit1.dcu'; // Show the component parts of this full name ShowMessage('Drive = '+ExtractFileDrive (fullFileName)); ShowMessage('Dir = '+Ex
阅读全文
摘要:QuickSort AlgorithOne of the common problems in programming is to sort anarray of valuesin some order (ascending or descending).While there are many "standard" sorting algorithms, QuickSort is one of the fastest.Quicksort sorts by employing adivide and conquer strategyto divide a list into
阅读全文