Delphi

Show mouse cursor in screenshot with delphi

不羁的心 提交于 2020-01-12 09:35:33
问题 Hi I am making a delphi xe function, the function is to take a screenshot, all goes well but the problem is I do not see the mouse cursor on any of the images taken. The code is as follows: procedure capturar_pantalla(nombre: string); // Credits : // Based on : http://www.delphibasics.info/home/delphibasicssnippets/screencapturewithpurewindowsapi // Thanks to www.delphibasics.info and n0v4 var uno: integer; dos: integer; cre: hDC; cre2: hDC; im: hBitmap; archivo: file of byte; parriba:

Show mouse cursor in screenshot with delphi

隐身守侯 提交于 2020-01-12 09:34:26
问题 Hi I am making a delphi xe function, the function is to take a screenshot, all goes well but the problem is I do not see the mouse cursor on any of the images taken. The code is as follows: procedure capturar_pantalla(nombre: string); // Credits : // Based on : http://www.delphibasics.info/home/delphibasicssnippets/screencapturewithpurewindowsapi // Thanks to www.delphibasics.info and n0v4 var uno: integer; dos: integer; cre: hDC; cre2: hDC; im: hBitmap; archivo: file of byte; parriba:

delphi判断文件类型

这一生的挚爱 提交于 2020-01-12 09:20:25
function getFileType(inputFile:string):string; const JPEG_FLAG_BEGIN = $D8FF; JPEG_FLAG_END = $D9FF; JPEG_FRAME = $C0FF; GIF_FLAG_BEGIN=$4947; GIF_FLAG_END=$3B00; PNG_FLAG_BEGIN=$5089; PNG_FLAG_END=$8260; BMP_FLAG_BEGIN=$4D42; EXE_FLAG_BEGIN=$5A4D; ZIP_7Z_FLAG_BEGIN=$7A37; ZIP_FLAG_BEGIN=$4B50; var FileStream: TFileStream; BeginFlag,EndFlag: WORD; begin result:='Unkown'; FileStream:=nil; try FileStream := TFileStream.Create(inputFile,fmOpenRead); FileStream.Position:=0; FileStream.Read(BeginFlag, SizeOf(BeginFlag)); FileStream.Position := FileStream.Size - 2; FileStream.Read(EndFlag, SizeOf

Add stretched image to ImageList in Delphi

眉间皱痕 提交于 2020-01-12 09:18:09
问题 I have a table contains Image in a Picture field and I am going to put them into an ImageList. Here is the code: ImageList.Clear; ItemsDts.First; ImageBitmap:= TBitmap.Create; try while not ItemsDts.Eof do begin if not ItemsDtsPicture.IsNull then begin ItemsDtsPicture.SaveToFile(TempFileBitmap); ImageBitmap.LoadFromFile(TempFileBitmap); ImageList.Add(ImageBitmap, nil); end; ItemsDts.Next; end; finally ImageBitmap.Free; end; But I have some problem for images with difference size from

How to get rid of TListBox vertical scroll limit?

我的未来我决定 提交于 2020-01-12 07:46:13
问题 I've implement a log viewer using a TListBox in virtual mode. It works fine (for all the code I wrote), displays the content as expected (I even added an horizontal scrollbar easily), but I guess I've reached the some kind of limit of the vertical scrollbar. That is, when I scroll the vertical bar from the top to the bottom, it will not scroll the content to the end of the list, but only to some limit. Do you know any possibility to get rid of this limit? I tried with SetScrollInfo , but it

Draw Sphere on TImage control of Delphi

心已入冬 提交于 2020-01-12 07:23:29
问题 I want to draw sphere like this: Below code is generates Circle's Vertices and Drawing a Circle on TIMAGE BUT i want it for SPHERE: for i := 0 to 360 do begin //Find value of X and Y pntCordXY.X := Radius * Cos(DegToRad(i)); pntCordXY.Y := Radius * Sin(DegToRad(i)); if i = 0 then image1.Canvas.MoveTo(Round(pntCordXY.X), Round(pntCordXY.Y)) else image1.Canvas.LineTo(Round(pntCordXY.X), Round(pntCordXY.Y)); end; 回答1: This turned out to be a fun exercise; nice question! At first, you ask

Hashtable implementation for Delphi 5

我与影子孤独终老i 提交于 2020-01-12 07:12:23
问题 Do you know a good and free Hashtable imlementation for Delphi 5 ? I need to organize a huge amount of data in a hastable and I am bit worried about memory leak issues that I found in most available implementations on the web. Tks 回答1: You can also check out the open-source / formerly commercial TurboPower SysTools. Not sure how much it is being updated. At one point Julian Bucknall recommended it over his EZDSL library, although that was back when he still worked fur TurboPower and it was

Dynamically add tab sheets to page control and embed a form?

ⅰ亾dé卋堺 提交于 2020-01-12 06:57:26
问题 I'm working on a module which consists of a page control. By default, this page control ( TPageControl ) shouldn't have any tab sheets ( TTabSheet ), but upon initialization, it should dynamically insert these pages and embed a form inside of it. The issue comes with knowing how to insert a tab sheet into the page control. How do I create this? And once it's created, along with the forms inside each one, how do I iterate through them to destroy the forms? 回答1: 1. How to dynamically create a

Dynamically add tab sheets to page control and embed a form?

随声附和 提交于 2020-01-12 06:57:08
问题 I'm working on a module which consists of a page control. By default, this page control ( TPageControl ) shouldn't have any tab sheets ( TTabSheet ), but upon initialization, it should dynamically insert these pages and embed a form inside of it. The issue comes with knowing how to insert a tab sheet into the page control. How do I create this? And once it's created, along with the forms inside each one, how do I iterate through them to destroy the forms? 回答1: 1. How to dynamically create a

Delphi - how to get a list of all files of directory

别来无恙 提交于 2020-01-12 06:36:09
问题 I am working with delphi, I want a list of all files of a directory when I execute openpicturedialog. i.e., When open dialog is executed and i select one file from it, I want the list of all files from the directory of selected file. You can even suggest me for getting directory name from FileName property of TOpenDialog Thank You. 回答1: @Himadri, the primary objective of the OpenPictureDialog is not select an directory, anyway if you are using this dialog with another purpose you can try this