Registration disabled at the moment Read more...
×


limelect
Members-
Content Count
930 -
Joined
-
Last visited
-
Days Won
1
limelect last won the day on April 15 2022
limelect had the most liked content!
Community Reputation
53 ExcellentRecent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Thanks, I thought so As you can see, I fixed it differently
-
I fixed it by bringing b := TBitmap.Create; b.Assign(ImgView321.Bitmap); Send B to functions However, if I load b from a file, it does not work. (MyBitmap) I still wonder. Any explanation?
-
Out of curiosity, I have 2 functions, one OK, the other not 2 exact function, the PNG returns a white picture, the TIFF works procedure BITMAPtoPNG2(MyBitmap: TBitmap; destinationfilename: string); var MyWIC: TWICImage; // preserves transparency begin // Assert( MyBitmap.PixelFormat := pf32bit; << it was 24 same result MyWIC := TWICImage.Create; try MyBitmap.AlphaFormat := afDefined; MyWIC.LoadFromFile(FileSave); <<<<<<<<<<<<<<<<<<<<<<I have to do that // MyWIC.Assign(MyBitmap); <<<<<<<<<<<<<<<<<<<<<<< this return white picture MyWIC.ImageFormat :=TWICImageFormat.wifPng ;//wifPng; if Form1.TestIfFileExist(destinationfilename) then MyWIC.SaveToFile(destinationfilename); finally MyWIC.Free; end; end; THIS IS OK procedure BITMAPtoTIFF(MyBitmap: TBitmap; destinationfilename: string); var MyWIC: TWICImage; begin MyWIC := TWICImage.Create; try MyWIC.Assign(MyBitmap); <<<<<<<<<<<<< This is OK MyWIC.ImageFormat := TWICImageFormat.wifTiff; if Form1.TestIfFileExist(destinationfilename) then MyWIC.SaveToFile(destinationfilename); finally MyWIC.Free; end; end;
-
Libreoffice integration struggles
limelect replied to Pierre le Riche's topic in RTL and Delphi Object Pascal
Tried the above source, and those lines did nothing LoadWriterDocumentFromBytes(BytesOf(TXTData)); // LoadWriterDocumentFromBytes(BytesOf(HTMLData),'HTML Document (Writer)'); // missing something may be // LoadWriterDocumentFromBytes(BytesOf(RTFData),'Rich Text'); // also LoadWriterDocumentFromBytes(BytesOf(CSVData), 'Text - txt - csv (StarCalc)', CSVFilterOption); // for some reason 'csv' is not enough -
Libreoffice integration struggles
limelect replied to Pierre le Riche's topic in RTL and Delphi Object Pascal
This worked for me a while ago (* // query the XComponentLoader interface from the desktop XComponentLoader xComponentLoader = (XComponentLoader)UnoRuntime.queryInterface( XComponentLoader.class, desktop); // create empty array of PropertyValue structs, needed for loadComponentFromURL PropertyValue[] loadProps = new PropertyValue[0]; // load new calc file XComponent xSpreadsheetComponent = xComponentLoader.loadComponentFromURL( "private:factory/scalc", "_blank", 0, loadProps); // query its XSpreadsheetDocument interface, we want to use getSheets() XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument)UnoRuntime.queryInterface( XSpreadsheetDocument.class, xSpreadsheetComponent); // use getSheets to get spreadsheets container XSpreadsheets xSpreadsheets = xSpreadsheetDocument.getSheets(); //insert new sheet at position 0 and get it by name, then query its XSpreadsheet interface xSpreadsheets.insertNewByName("MySheet", (short)0); Object sheet = xSpreadsheets.getByName("MySheet"); XSpreadsheet xSpreadsheet = (XSpreadsheet)UnoRuntime.queryInterface( XSpreadsheet.class, sheet); // use XSpreadsheet interface to get the cell A1 at position 0,0 and enter 21 as value XCell xCell = xSpreadsheet.getCellByPosition(0, 0); xCell.setValue(21); // enter another value into the cell A2 at position 0,1 xCell = xSpreadsheet.getCellByPosition(0, 1); xCell.setValue(21); // sum up the two cells xCell = xSpreadsheet.getCellByPosition(0, 2); xCell.setFormula("=sum(A1:A2)"); // we want to access the cell property CellStyle, so query the cell's XPropertySet interface XPropertySet xCellProps = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, xCell); // assign the cell style "Result" to our formula, which is available out of the box xCellProps.setPropertyValue("CellStyle", "Result"); // we want to make our new sheet the current sheet, so we need to ask the model // for the controller: first query the XModel interface from our spreadsheet component XModel xSpreadsheetModel = (XModel)UnoRuntime.queryInterface( XModel.class, xSpreadsheetComponent); // then get the current controller from the model XController xSpreadsheetController = xSpreadsheetModel.getCurrentController(); // get the XSpreadsheetView interface from the controller, we want to call its method // setActiveSheet XSpreadsheetView xSpreadsheetView = (XSpreadsheetView)UnoRuntime.queryInterface( XSpreadsheetView.class, xSpreadsheetController); // make our newly inserted sheet the active sheet using setActiveSheet xSpreadsheetView.setActiveSheet(xSpreadsheet); } catch( com.sun.star.lang.DisposedException e ) { //works from Patch 1 xRemoteContext = null; throw e; } *) unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls; type TForm1 = class(TForm) Panel1: TPanel; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} uses System.Win.ComObj; procedure TForm1.Button1Click(Sender: TObject); var xSpreadsheet,sheet,xCell,xSpreadsheets ,args,objDocument,objDesktop,Excel, Book: OleVariant; RowNumber: integer; ColNumber: integer; const xlCellTypeLastCell = $0000000B; // ExcelXP begin //excel := CreateOleObject('Excel.Application'); excel := CreateOleObject('com.sun.star.ServiceManager'); objDesktop:=excel.createInstance('com.sun.star.frame.Desktop'); args := VarArrayCreate([0,1], varVariant); // objDocument:=objDesktop.loadComponentFromURL('private:factory/swriter','_blank', 0, args) ; //load empty documemt // objDocument:=objDesktop.loadComponentFromURL('private:factory/swriter','G:\Delphi Projects\engineertips\Excel Row and Column Count\world_gps_map_database.xls', 0, args) ; objDocument:=objDesktop.loadComponentFromURL('private:factory/scalc','_blank', 0, args) ; //load new excel xSpreadsheets:= objDocument.getSheets; xSpreadsheets.insertNewByName('MySheet', 0); sheet := xSpreadsheets.getByName('MySheet'); // xSpreadsheet := (XSpreadsheets).queryInterface( XSpreadsheet.class, sheet); //xCell := xSpreadsheets.getCellByPosition(0, 0); xCell := sheet.getCellByPosition(0, 0); xCell.setValue(21); xCell := sheet.getCellByPosition(1, 0); xCell.setValue(521); // RowNumber := Sheet.UsedRange.EntireRow.Count; (* excel.Workbooks.Open( 'G:\Delphi Projects\engineertips\Excel Row and Column Count\world_gps_map_database.xls' ); // Sheet := excel.ActiveWorkbook.Worksheets[SheetName]; Book := Excel.Workbooks.Open('G:\Delphi Projects\engineertips\Excel Row and Column Count\world_gps_map_database.xls', False, // ConfirmConversions True ); // ReadOnly Sheet := Book.Worksheets[1]; //RowNumber := Sheet.UsedRange.EntireRow.Count; // May be wrong! //ColNumber := Sheet.UsedRange.EntireColumn.Count; // May be wrong! RowNumber := Sheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row; ColNumber := Sheet.UsedRange.SpecialCells(xlCellTypeLastCell).Column; *) end; end. -
Broken Project Path References due to Misused “Save As” in Delphi (RAD Studio)
limelect replied to Badnaf's topic in FMX
@Gabor64738 No, I think another way First, throw away all the files except the DPR fmx res and pas. Now load the DPR. Usually, this will be OK. If not, there is another option. Edit the DPR so All the paths will only be the file names. With that said, you have here are all the project files. And lastly, if this did not help, make a new project (name the new main to the old main) and also the project name to the old one. Change (copy) pas and fmx of the old main to the new one, then add all other pas files to the project. Doen. -
@Dave NottageWell, you might be right, but as a professional using Pascal even before Delphi, I do not have the strength to use failing products. For Android, I will stick with Android Studio even though Delphi is better in that area and wait for a new version Maybe I will give it one more shot
-
I will wait for Delphi 13, maybe it will be better
-
The error saise Cannot locate sdk api level in this path..... I geuss it is not 32 bit
-
Yes, I started by checking the Java path, but on the 32 it does not allow me to change Furthermore, I tried to compile to 64, but it wants to update. I say ye,s it fails with no reason
-
@Dave Nottage It is a mess; most directories are bad On Java 32-bit, it does not allow me to change it Maybe because I put both 32 and 64 as the same directory? The adb.exe does not exist and so on Up to today, I have bought all the Delphi. Should I buy now? Is this a Delphi joke
-
No SDK in the directory after installation of D12 C:\Users\Public\Documents\Embarcadero\Studio\23.0\CatalogRepository\AndroidSDK-2525-23.0.51961.7529 On my d10.2.3, there are a few exe files, including AVD Manager.exe C:\Users\Public\Documents\Embarcadero\Studio\19.0\CatalogRepository\AndroidSDK-2433_19.0.27659.1188 SDK base path I did choose Android during the installation Can I copy my d10 to my d12 ? or what On compiling, I get initialization of VM error D12 community edition P.S I have seen this
-
@Cristian Peța Sdk and Java it is not the same problem SDK is ok, but the link to Java is false Now the error is initialization of VM after putting Java at bin directory
-
Cannot deploy the application All Java should be in c:\bin, why? Ok, I put Java in bin Now it need c:\bin\ client\jvm.dll So I made this directory with jvm.dll I have jvm.dll in the server directory Lastly, I have this error during the initialization of VM Obviously, D12 did not initialize its Java during installation Any help?