Re: Paint like component



Rudy wrote:

> I am looking for a very basic paint like component, i will be used to
> read peoples signatures and then save them to file. Nothing fancy
> just a pen and "canvas" really

Use TPaintBox comes by default with delphi.

Then save the item as a bitmap.

var
Bitmap: TBitmap;
Source: TRect;
Dest: TRect;
begin
Bitmap := TBitmap.Create;
try
with Bitmap do
begin
Width := MyPaintBox.Width;
Height := MyPaintBox.Height;
Dest := Rect(0, 0, Width, Height);
end;
with MyPaintBox do
Source := Rect(0, 0, Width, Height);
Bitmap.Canvas.CopyRect(Dest, MyPaintBox.Canvas, Source);
Bitmap.SaveToFile('MYFILE.BMP');
finally
Bitmap.Free;
end;
end;

--
Liz the Brit
Delphi things I have released: http://www.xcalibur.co.uk/DelphiThings
.



Relevant Pages

  • Re: GetDIBits richtig verwenden
    ... > hardware besser als normale GDI funktionen DirectX macht das auch. ... Allerdings selektiere ich das Bitmap nach dem Erzeugen in einen DC, ... Ich bin von Delphi auf C++ umgesprungen, weil die Programme kleiner werden, ... Next by Date: ...
    (microsoft.public.de.vc)
  • Re: Anyone have any info on the Delphi bitmaps?
    ... I pulled the BMP format ... Everything after the 424D is saying Windows Bitmap. ... It looks like that dfm file is a Delphi 6 file. ... > .dfm files tend to hold bitmap information ...
    (microsoft.public.vb.general.discussion)
  • Re: How to access all the pixels of a bitmap with C#?
    ... In Delphi, you can use TBitmap.Scanline property to access ... > all the pixels of a bitmap object. ... /// Create a gray gradient bar to represent the colors palette. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to access all the pixels of a bitmap with C#?
    ... Xiaoguang ... In Delphi, you can use TBitmap.Scanline property to ... >> all the pixels of a bitmap object. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Loading Stock Bitmaps
    ... left corner of a window - into a bitmap. ... LoadBitmapBynum API call but the few clues I have found in Delphi indicate ... Include the resource file in your form unit. ...
    (borland.public.delphi.language.objectpascal)