You are not logged in.
I just use UpdateFromServer on my clients but I get some "blocking" problem.
My clients have some grids. For any grid I use a TSQLTableJSON to retrive data from some tables, then I use UpdateFromServer to know if there a update data.
My problem is this if UpdateFromServer I must retrive a now TSQLTableJSON with ALL to update the client grid.
Also if there only a update record of TSQLTableJSON I don't know it so I must retrive ALL in this way I have a "blocking" problem (for 3-4 seconds).
My application use a server-clients systems, so I have a server application and many clients applications.
The clients can edit database table so I have added a procedure to update te GUI all other clients with a client edit the database.
What is the best way to do it? I need a fast and no-blocking system.
I think the best way is allow to server send the new record to all the clients when there are some update but I don't know if this is possible.
I'm not an expert of server-clients systems so I'd like know what is the best way to do it.
Thanks
Is there a way to do this:
1. create a PDF with many pages;
2. the pages can have differente size (ex. A4, A3 or custom size);
3. the pdf must have high resolution (ex. 300 dpi), because I must stamp big bitmap on page.
Yes, I know, I have try to comment them but I get always a big page: about 87 cm x 123 cm...
If I set DefaultPageWidth/Heigh I get the same result.
dpi := 300;
lPdf.DefaultPageWidth := Round(dpi * 210 / 25.4);
lPdf.DefaultPageHeight := Round(dpi * 297 / 25.4);
lPdf.DefaultPaperSize := psUserDefined;
lPdf.PDFA1 := True;
lPdf.ScreenLogPixels:=dpi;
lPage := lPDF.AddPage;
lPage.PageWidth := Round(dpi * 210 / 25.4);
lPage.PageHeight := Round(dpi * 297 / 25.4);Because in my example I have used an A4 pages but general I don't know the page size until extract the image from my original PDF (no PDF/A-1), so I need use 2 variables to set Width and Height.
Something like:
dpi := 300;
lPdf.DefaultPaperSize := psUserDefined;
lPdf.PDFA1 := True;
lPdf.ScreenLogPixels:=dpi;
lPage := lPDF.AddPage;
lPage.PageWidth := Round(dpi * pWidth / 25.4);
lPage.PageHeight := Round(dpi * pHeight / 25.4);Any idea?
Thank you for your reply.
I have write a small piece of code but I have a problem because I don't understand how can I handle the image resolution.
I have extract 2 bitmap from my PDF: 1 bitmap from A4 page with 300 dpi and 1 bitmap from A3 page with 300 dpi;
Now I need create a PDF/A-1 with 2 pages (A4 + A3) but I cannot lost information about resolution. How can I set the page?
This is a piace of my code:
dpi := 300;
lPdf.DefaultPaperSize := psUserDefined;
lPdf.PDFA1 := True;
lPdf.ScreenLogPixels:=dpi;
lPage := lPDF.AddPage;
lPage.PageWidth := Round(dpi * 210 / 25.4);
lPage.PageHeight := Round(dpi * 297 / 25.4);If I use dpi=72 (screen resolution) I get a PDF with A4 page (21cm x 29,7 cm) but if I set dpi=300 I get a big page.
I don't understand how cannot lost the resolution of my origin image.
I need of advice to understand if I can use your PDF Engine on my project.
In my project I use an external library to extract PDF page as image (with 200/300 dpi).
Now I need convert a PDF to PDF/A-1. I know your library cannot read a PDF but it can write a PDF/A-1, so I think I can extract all page of my PDF as bitmap then use your library to generate a PDF/A-1 with an image for page.
Questions:
1. Is it possible with your PDF Engine?
2. My image are big (200/300 dpi) but the PDF page are simple: text, tables and some small image so I cannot need of a perfect copy of it. Is there a way to reduce the PDF/A-1 size?
3. Do you think this is a good (not best) solution? I have PDF with 5/20 pages, the PDF/A-1 will take many time?
regards
CamStudio is freeware and opensource. It's not perfect but can be a good solution: http://sourceforge.net/projects/camstudio/
But if I use the DLL library from wxsqlite instead of OBJ, how can use my encrypted database. Must I change my code? How?
What version of sqlite is based this "AES" library? I cannot find details.
Hi,
I have a TBitmap or a TCanvas with a picture. Now I need add some semitransparent polygons with different color over picture.
I think this is possible with GDI+ but I cannot get information about it.
Is it possible get a piace of code about it?
Thanks
I don't change the db right, and the first application that I run can access without problem, so I don't think it is a access right problem.
Hi,
I have a software that use MDB (access) database to save the data.
In my application I use TOleDBConnectionProperties to connect with this DB and read/write some data.
However I have a small problem. I cannot run the software together, in fact if I try to run the applications together I get an error from the application that I started to second because the DB is block.
Is there a way to avaoid it? My application is similar to other software that allow it without problem, so I think this is possible but i don't know how.
regards
On my application I use this code:
for b := 0 to Length(ContactsRecords.RecordProps.FieldsName) - 1 do
begin
var1 := StringReplace(var1, '[' + ContactsRecords.RecordProps.FieldsName[b] + ']', UTF8ToString(ContactsRecords.GetFieldValue(ContactsRecords.RecordProps.FieldsName[b])), [rfReplaceAll, rfIgnoreCase]);
var2 := StringReplace(var2, '[' + ContactsRecords.RecordProps.FieldsName[b] + ']', UTF8ToString(ContactsRecords.GetFieldValue(ContactsRecords.RecordProps.FieldsName[b])), [rfReplaceAll, rfIgnoreCase]);
var3 := StringReplace(var3, '[' + ContactsRecords.RecordProps.FieldsName[b] + ']', UTF8ToString(ContactsRecords.GetFieldValue(ContactsRecords.RecordProps.FieldsName[b])), [rfReplaceAll, rfIgnoreCase]);
end;On last version of your framework TSQLRecordProperties.FieldsName is remove, why?
How can I replace my code?
in fact. for the moment I have convert my png to bitmap 32bit so can avoid the problem. I hope this bug will be fixed
I use it on XE3 without problem.
Good, so it's there a bug or a problem with last version of Delphi...
On old version it's works (I have tested only on Delphi 2006).
OK.
1. Is there a way to use SQL (for example call "VACUUM") with TSQLRest? Or si it right use TSQLRestServerDB.
2. "use a transaction (and a batch process)" but for this I need of TSQLRestClientDB and then of TSQLRestServerDB, right?
OK, I have read the article.
But:
1) TSQLRestServerDB doesn't have a Synchronous property, where I find it?
2) I need use TSQLRestClientDB e TSQLRestServerDB also if I use a local database?
Can someone test my demo on XE3?
I must add about 250000 record on a SQLite table. My code works but it's very slow.
MyRecord := TSQLMyTable.Create;
try
MyRecord .AAA:= StringToUTF8('test');
MyRecord .BBB := StringToUTF8('test');
MyRecord .CCC := StringToUTF8('test');
if Database.Add(TAFRecord, True) > 0 then
begin
end;
finally
TAFRecord.Free;
end;I'm working on local computer (no client/server) and I use "Database: TSQLRestServerDB;" (I cannot use "Database: TSQLRest;" because I need EngineExecuteAll to run "VACUUM" sql).
Can you help me?
With Delphi XE3?
Please see the small demo: http://dl.dropbox.com/u/19900180/pngproblem.zip
The code is very simple:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, SynGdiPlus, Vcl.Imaging.pngimage,
Vcl.ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
initialization
Gdip.RegisterPictures;
end.There is only a form with a PNG, on design time I can see the PNG but on run time I cannot see it (see the exe demo).
I don't understand...
Do you have some ideas?
PS with Delphi 2006 I don't have this problem.
Are there other users with the same problem? I cannot use PNG any more...
I have a small problem.
Today I have convert my application from Delphi 2006 to Delphi XE3.
All the code works without problem but I have a small bug, I need to use
initialization
Gdip.RegisterPictures;to use the code above (save/load image from/to database) but with this code at runtime all my TImage with PNG image are black, if I comment this code I can see all PNG on my TImage but I cannot save/load image from/to database.
How can I solve it?
Thanks
Hi,
I need save a PNG (with transparent) on a field of my database and the load it to show on my form.
I think I can use the code write for bitmap:
SAVE:
var
doc: RawByteString;
begin
SaveAsRawByteString(imgDocument.Picture,doc,gptPNG,80,1500);
Database.UpdateBlob(TSQLContacts, Contact.ID, 'Document', doc);
end;my problem is the code to LOAD the image, now in fact I use:
var
doc: TSQLRawBlob;
pic: TBitmap;
begin
Database.RetrieveBlob(TSQLContacts, Contact.ID, 'Document', doc);
Contact.Document := doc;
pic := PictureToBitmap(ContattoRecord.Document);
if pic <> nil then
begin
image.Picture.Bitmap.Assign(pic);
pic.Free;
end;
end;Where PictureToBitmap is:
function PictureToBitmap(const Picture: RawByteString): TBitmap;
var
ST: THeapMemoryStream;
begin
Result := nil;
if Picture='' then
exit;
ST := THeapMemoryStream.Create;
try
ST.Write(pointer(Picture)^,length(Picture));
with TSynPicture.Create do
try
LoadFromStream(ST);
result := ToBitmap;
finally
Free;
end;
finally
ST.Free;
end;
end;Is there a way to get a PNG and not a BMP? In PictureToBitmap there is ToBitmap to get a bitmap, but for other images format?
OK, it's possible add a IMPORT feature into SynDBExplorer to import from csv file. So I can avoid to use external SQLite editor.
Titolo is RawUTF8:
TSQLMyRecord = class(TSQLRecord)
private
fTitolo: RawUTF8;
published
property Titolo: RawUTF8 read fTitolo write fTitolo;
end;I have create the databse by framework (so I think the data type is correct), then I have popolate the database by an external editor (http://sqliteadmin.orbmu2k.de/).
I just to it the same things when I have develop another application without problem, ...
Hi,
I'm not follow the last change on your frameworks.
I have start a new application develop with Delphi 2006 and I have update the frameworks with last build.
I have a strange problem: if I use UTF8ToString() the result string doesn't have some char like à, ò, ù, ...
For example:
MyRecord := TSQLMyRecord.CreateAndFillPrepare(Database, '');
try
while MyRecord.FillOne do
begin
if MyRecord.ID <> 0 then
begin
MessageDlg(MyRecord.Titolo,mtError, [mbOK], 0); // GET RIGHT STRING TEXT: "qualità"
MessageDlg(UTF8ToString(MyRecord.Titolo),mtError, [mbOK], 0); // GET BAD STRING TEXT: "qualit"
end;
end;
finally
MyRecord.Free;
end;Do you have change somethings on your framework? Any ideas?
I will check gdiplus.dll and the I will report the result.
I need to create a TIFF from a BMP with 200dpi and evCompressionCCITT4, do you know other delphi class or small library for this?
My searches have not led to anything.
I have download Windows Imaging Component but when I try to install it I get an error because the last version is just installed on my Windows XP.
I have also copy gdipluss.dll library on my application path, but also this not work.
I don't have an error, only a TIFF file empty...
Other ideas about it?
I don't understand the minimum to use the SynGDIPlus.
I have tested my code on Windows 7 without problem, but on Windows XP I get a TIF image of 0 kb...
Which OS I need? Is there a way to extend the use?
I have solved using ord(evCompressionCCITT4) on SynGDIPlus.SaveAs.
Thanks
Many thanks.
Other question ![]()
Is there a way to set color depth? I need of a tiff with 1bit of color (only black and with, no gray scale). Is it possible?
Thanks again.
I have check the code. I think in this moment is not possible set DPI.
Is it possible add this feature?
OK.
For example I want create a 10x11 inch image with 100 dpi.
I can use:
var Bmp: TBitmap;
MF: TMetaFile;
MetafileCanvas: TMetafileCanvas;
begin
Gdip := TGDIPlusFull.Create('gdiplus.dll');
MF := TMetaFile.Create;
MF.Width := 1000;
MF.Height := 1100;
MetafileCanvas := TMetafileCanvas.Create(MF, 0);
MetafileCanvas.Brush.Color := clRed;
MetafileCanvas.Brush.Style := bsDiagCross;
MetafileCanvas.Ellipse(50, 50, 300 - 50, 200 - 50);
MetafileCanvas.Free;
Bmp := Gdip.DrawAntiAliased(MF);
Image1.Picture.Assign(Bmp);
SynGDIPlus.SaveAs(Bmp, 'c:\test.tif', gptTIF);
Bmp.Free;
MF.Free;
FreeAndNil(GdiP);
end;In this way the TIFF have always 96 DPI (screen resolution). How can I change it?
Thanks
I need some advice.
I have develop a small component that use a TPaintBox, I use the TPainBox to draw on canvas some objects (line, point, circle, ...).
Now I need save my canvas as a TIFF with specific size and resolution (200 dpi) if possible with antialiased.
I'd like know if and how can I do it with your framework. Is it possible? It there a piace of code about it? Which is the more easy way to not rewrite all my code?
Thanks
OK I think I have found the problem.
This code works:
procedure AddPortTo7Firewall(const EntryName: string; PortNumber: cardinal);
var
fwMgr, profile, NewRule, RulesObject: OleVariant;
begin
fwMgr := CreateOleObject('HNetCfg.FwPolicy2');
profile := NET_FW_PROFILE2_PRIVATE OR NET_FW_PROFILE2_PUBLIC;
try
RulesObject := fwMgr.Rules;
NewRule := CreateOleObject('HNetCfg.FWRule');
try
NewRule.Name := EntryName;
NewRule.Description := EntryName;
NewRule.Protocol := NET_FW_IP_PROTOCOL_TCP;
NewRule.LocalPorts := PortNumber;
NewRule.Enabled := TRUE;
NewRule.Profiles := Profile;
NewRule.Action := NET_FW_ACTION_ALLOW;
RulesObject.Add(NewRule);
finally
NewRule := varNull;
RulesObject := varNull;
end;
finally
profile := varNull;
fwMgr := varNull;
end;
end;NOTE: set NewRule.Protocol before NewRule.LocalPorts.
Thanks again.
I have try it but I get an error on IntToStr(PortNumber); "Parameter is not correct.".
I don't understand why...
If I remember correctly I have tried to use an string without success. I'll try again (in this moment I'm not in my office) and I'll let you know.
Yes, I just see it and AddExceptionToFirewall (of stackoverflow) works well, but with it I can only add application not port. I need open a port.
Any ideas?
I wrote this code:
procedure AddPortTo7Firewall(const EntryName: string; PortNumber: cardinal);
var
fwMgr, profile, NewRule, RulesObject: OleVariant;
begin
fwMgr := CreateOleObject('HNetCfg.FwPolicy2');
profile := NET_FW_PROFILE2_PRIVATE OR NET_FW_PROFILE2_PUBLIC;
try
RulesObject := fwMgr.Rules;
NewRule := CreateOleObject('HNetCfg.FWRule');
try
NewRule.Name := EntryName;
NewRule.Description := EntryName;
NewRule.LocalPorts := PortNumber;
NewRule.Protocol := NET_FW_IP_PROTOCOL_TCP;
NewRule.Enabled := TRUE;
NewRule.Profiles := Profile;
NewRule.Action := NET_FW_ACTION_ALLOW;
RulesObject.Add(NewRule);
finally
NewRule := varNull;
RulesObject := varNull;
end;
finally
profile := varNull;
fwMgr := varNull;
end;
end;I think this is the right way but I get an error on NewRule.LocalPorts, and I don't understand why, Any ideas?
This is OK, but AddPortToXPFirewall doesn't work on Windows 7 (as administrator), I need fix it to run as administrator not as user.
On SQLite3UI.pas I have found these procedures:
procedure AddApplicationToXPFirewall(const EntryName, ApplicationPathAndExe: string);
procedure AddPortToXPFirewall(const EntryName: string; PortNumber: cardinal);
I need use them on my application to change firewall settings. I just have fix AddApplicationToXPFirewall to works also with Private profile (in this moment in fact it works only with Public profile - on Windows 7).
Now I need use AddPortToXPFirewall on Windows 7 but I don't know how I need edit it. In fact in this moment it doesn't work.
I need of AddPortToXPFirewall to open 2 ports by my application (both on Private and Pubblic profiles).
Thanks
I don't understand if I have found a bug.
TSQLDBStatement.TotalRowsRetrieved return always 0 until I call TSQLDBStatement.Step, how can I know the row number?
Did you try setting the User (Admin?) + Password fields?
I think the Jet syntax is not the OleDB standard.
Need to fix it.
Yes.
So I need use "Generc OLEDB", right?
And where I set the password? I have try to set on password field but it doesn't work.
Thanks.
A question Can I use "Jet - mdb OLEDB" with a database protected by password? (see ADO like connect string of first post).
Thank you. I will wait for it.
I think the problem is Props.GetTableNames(C.fTableNames); of SynDBExplorer.
I hope this can help you.
I think on "at connection opening" because I get the error after click on "OK" button of "OLEDB connection box". I hope I have understand your question.
I get error on OleDBCheck procedure.