Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  251

•  TDictionary Custom Sort  3 400

•  Fast Watermark Sources  3 156

•  3D Designer  4 913

•  Sik Screen Capture  3 407

•  Patch Maker  3 610

•  Айболит (remote control)  3 814

•  ListBox Drag & Drop  3 074

•  Доска для игры Реверси  82 420

•  Графические эффекты  4 011

•  Рисование по маске  3 310

•  Перетаскивание изображений  2 685

•  Canvas Drawing  2 825

•  Рисование Луны  2 638

•  Поворот изображения  2 249

•  Рисование стержней  2 189

•  Paint on Shape  1 589

•  Генератор кроссвордов  2 270

•  Головоломка Paletto  1 788

•  Теорема Монжа об окружностях  2 283

•  Пазл Numbrix  1 701

•  Заборы и коммивояжеры  2 078

•  Игра HIP  1 296

•  Игра Go (Го)  1 248

•  Симулятор лифта  1 493

•  Программа укладки плитки  1 241

•  Генератор лабиринта  1 565

•  Проверка числового ввода  1 385

•  HEX View  1 515

•  Физический маятник  1 372

 
скрыть


Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

График и отображаемый в память файл



unit MapGForm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, SyncObjs, TeEngine, Series, ExtCtrls, TeeProcs, Chart, Grids,
  ComCtrls;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Chart1: TChart;
    Series1: TBarSeries;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    hMapFile: THandle;
    MapFilePointer: Pointer;
  public
    procedure WmUser(var Msg: TMessage); message wm_user;
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
var
  Address: Pointer;
  X, Y, Total: Integer;
begin
  hMapFile := CreateFileMapping(
    $FFFFFFFF, // file handle ... or memory
    nil, // security
    Page_ReadWrite, // access rights
    0, // high memory size
    10000, // low memory size
    'DdhMappedFileGraph'); // mapped file name
  if hMapFile <> 0 then
    MapFilePointer := MapViewOfFile(
      hMapFile, // handle returned above
      File_Map_All_Access, // access rights
      0, 0, 0) // access the entire mapped file
  else
    ShowMessage('hMapFile = 0');
  if MapFilePointer = nil then
    ShowMessage('MapFilePointer = nil')
  else
  begin
    // add window to area
    Address := pChar(MapFilePointer) + 400;
    while PInteger(Address)^ <> 0 do
      Address := pChar(Address) + 4;
    PInteger(Address)^ := Handle;
  end;
  // start up chart
  Chart1.Series[0].Clear;
  for X := 0 to 9 do
  begin
    Total := 0;
    for Y := 0 to 9 do
    begin
      Address := pChar(MapFilePointer) + (X + Y * 10) * 4;
      Inc(Total, PInteger(Address)^);
    end;
    Chart1.Series[0].AddY(
      Total, IntToStr(X + 1), clRed);
  end;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  UnMapViewOfFile(MapFilePointer);
  CloseHandle(hMapFile);
end;

procedure TForm1.WmUser(var Msg: TMessage);
var
  X, Y, Total: Integer;
  Address: Pointer;
begin
  // copy all the data to the graph
  for X := 0 to 9 do
  begin
    Total := 0;
    for Y := 0 to 9 do
    begin
      Address := pChar(MapFilePointer) + (X + Y * 10) * 4;
      Inc(Total, PInteger(Address)^);
    end;
    Chart1.Series[0].YValue[X] := Total;
  end;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
  X, Y: Integer;
  Address: Pointer;
begin
  X := Random(10);
  Y := Random(10);
  Address := pChar(MapFilePointer) + (X + Y * 10) * 4;
  PInteger(Address)^ := PInteger(Address)^ + Random(10);
  Address := pChar(MapFilePointer) + 400;
  while PInteger(Address)^ <> 0 do
  begin
    PostMessage(PInteger(Address)^, wm_user, 0, 0);
    Address := pChar(Address) + 4;
  end;
end;

initialization
  Randomize;
end.




Похожие по теме исходники

MGraph (построение графиков)

Grapher - Черчение графиков

График работы

Чтение PSD файлов

 

Шифратор файлов

Разбиение файла на части

Поиск файлов

FileMan (менеджер файлов)

 

Поиск открытых файлов

Текст внутри файла




Copyright © 2004-2024 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте