Графика в Delphi - примеры задач на построение графиков, а также компоненты для графики

Загружать большие битовые изображения с небольшим использованием памяти

function MyGetMem(Size: DWORD): Pointer;
begin
Result := Pointer(GlobalAlloc(GPTR, Size));
end;

procedure MyFreeMem(p: Pointer);
begin
if p = nil then Exit;
GlobalFree(THandle(p));
end;

{ This code will fill a bitmap by stretching an image coming from a big bitmap on disk.

FileName.- Name of the uncompressed bitmap to read
DestBitmap.- Target bitmap where the bitmap on disk will be resampled.
BufferSize.- The size of a memory buffer used for reading scanlines from the physical bitmap on disk.
This value will decide how many scanlines can be read from disk at the same time, with always a
minimum value of 2 scanlines.
Read more »

Форма окна по Bitmap

unit Unit1;

interface

uses
Windows, Classes, SysUtils, Graphics, Forms;

type
TRGBArray = array[0..32767] of TRGBTriple;
PRGBArray = ^TRGBArray;

type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
FRegion: THandle;
function CreateRegion(Bmp: TBitmap): THandle;
end;

var
Form1: TForm1;

implementation

{$R *.dfm}
Read more »

Как из Handle битовой картинки, получить адрес битового изображения в памяти

Вот кусок одного моего класса, в котором есть две интересные вещицы - проецирование файлов в память и работа с битмэпом в памяти через указатель.

Сразу оговорюсь, что все это работает только под Win95/NT.

type
TarrRGBTriple = array[byte] of TRGBTriple;
ParrRGBTriple = ^TarrRGBTriple;

{организует битмэп размером SX,SY;true_color}

procedure TMBitmap.Allocate(SX, SY: integer);
var
DC: HDC;
begin
if BM <> 0 then
DeleteObject(BM); {удаляем старый битмэп, если был}
BM := 0;
PB := nil;
fillchar(BI, sizeof(BI), 0); Read more »

Как создать BMP из ICO

procedure TForm1.Button1Click(Sender: TObject);
var
TheIcon: TIcon;
TheBitmap: TBitmap;
begin
TheIcon := TIcon.Create;
TheIcon.LoadFromFile(’C:\Program Files\Borland\IcoCur32\EARTH.ICO’);
TheBitmap := TBitmap.Create;
TheBitmap.Height := TheIcon.Height;
TheBitmap.Width := TheIcon.Width;
TheBitmap.Canvas.Draw(0, 0, TheIcon);
Form1.Canvas.Draw(10, 10, TheBitmap);
TheBitmap.Free;
TheIcon.Free;
end;

Как создать BMP из ICO

Способ преобразования изображения размером 32×32 в иконку.

unit main;

interface

uses

Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, ExtCtrls, StdCtrls;

type

TForm1 = class(TForm)
Button1: TButton;
Image1: TImage;
Image2: TImage;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
Read more »

Powered WP Ъ скачать delphi, delphi 7, скачать delphi 7, delphi файлы, delphi, компоненты, delphi 2009, delphi программы, delphi бесплатно, delphi скачать, бесплатно работа delphi, delphi создание, delphi строки, программирования delphi, borland delphi, delphi формы