Convert Image To Bmp
Scrool BLOB
procedure TFormUtama.dataunitAfterScroll(DataSet: TDataSet);
var
JpegImage: TJPEGImage;
BlobStream: TStream;
begin
if (not dataunit.FieldByName('image').IsNull)
then
begin
BlobStream := dataunit.CreateBlobStream(dataunit.FieldByName('image'),bmRead);
JpegImage := TJPEGImage.Create;
try
JpegImage.LoadFromStream(BlobStream);
gambar.Picture.Assign(JpegImage);
gambar.Visible := True;
finally
JpegImage.Free;
BlobStream.Free;
end;
end
else
gambar.Visible := False;
end;
BLOB Image
procedure TFormUtama.BitBtn23Click(Sender: TObject);
var
FileStream: TFileStream;
BlobStream: TStream;
begin
if (odBlob.Execute) then
begin
dataunit.Edit;
try
BlobStream := dataunit.CreateBlobStream(dataunit.FieldByName('image'),bmWrite);
FileStream := TFileStream.Create(odBlob.FileName,fmOpenRead or fmShareDenyNone);
BlobStream.CopyFrom(FileStream,FileStream.Size);
FileStream.Free;
BlobStream.Free;
dataunit.Post;
dataunitAfterScroll(dataunit);
except
dataunit.Cancel;
end;
end;
end;
Bitmap: TBitmap
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;
Generated Pdf File Pada QuickRep
procedure TFormFaktur.Button7Click(Sender: TObject);
var
aPDF : TQRPDFDocumentfilter;
begin
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.Add('select* from d_transaksi where nofak like "'+DBEdit2.Text+'" AND codestore="'+DBLookupComboBox3.Text+'" and lokasi="'+DBLookupComboBox5.Text+'" ');
ADOQuery2.SQL.Add('ORDER BY id ASC');
ADOQuery2.Open;
ADOQuery8.SQL.Clear;
ADOQuery8.SQL.Add('select* from lokasiproject where codestore="'+DBLookupComboBox3.Text+'"');
ADOQuery8.Open;
QuickRep1.prepare;
QuickRep1.QRPrinter.Free;
QuickRep1.QRPrinter := nil;
if FileExists('image/'+DBEdit5.Text+'.jpg') then
QRImage5.Picture.LoadFromFile('image/'+DBEdit5.Text+'.jpg');
if FileExists('image/'+DBEdit6.Text+'.jpg') then
QRImage6.Picture.LoadFromFile('image/'+DBEdit6.Text+'.jpg');
aPDF := TQRPDFDocumentfilter.Create(DBEdit10.Text+Edit1.Text+DBEdit11.Text+Edit1.Text+DBEdit7.Text+Edit1.Text+DBEdit8.Text+Edit1.Text+DBEdit9.Text+'.pdf');
QuickRep1.ExportToFilter( aPDF);
aPDF.free;
showmessage('File Berhasil Di Buat');
Exit;
end;
============================
Lanjuut......
Copy File Backup Tanpa Kompresi
Membuat Copy File Backup Tanpa Kompresi
=====================
CopyFile(PChar('agusdb.mdb'),PChar((Edit21.Text)),true);
=====================
Note. Edit21.Text = Nama File Backup Anda
Quick PDF Library 8.13
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,QuickPDF0813, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
PDFLibrary: TQuickPDF0813;
UnlockResult: Integer;
begin
PDFLibrary := TQuickPDF0813.Create;
try
UnlockResult := PDFLibrary.UnlockKey('kode-licency');
if UnlockResult = 1 then
begin
PDFLibrary.DrawText(100, 500, 'Hello from Delphi');
PDFLibrary.SaveToFile('C:\HelloFromDelphi.pdf');
end else
begin
ShowMessage('kode licency salah');
end;
finally
PDFLibrary.Free;
end;
end;
end.