Recent

Recent Posts

Pages: 1 [2] 3 4 ... 10
11
General / Re: FPC v3.2.2 internal error
« Last post by PascalDragon on Today at 06:14:07 pm »
It would  be very nice if this problem did not occur in the upcoming v3.2.4

Considering that according to ALLIGATOR that's not even fixed in main, very unlikely. Please report a bug.
12
@wp: it's still slower than operating on a bitmap from the beginning
13
LCL / Re: Distance of gridlines in fpspreadsheet chart
« Last post by wp on Today at 06:04:34 pm »
Sorry, I should have been more specific: fpspreadsheetchart.pas is in the folder source/visual of the fpspreadsheet installation.

Another indication of the new version is the method TsSpreadOOXMLChartReader.WriteChartLabels in file source/common/xlsxooxmlchart.pas which has "ARotationAngle: single" as last parameter now (the last argument was "AFont: TsFont" in the old version).

Since you are showing a subfolder common.zip here, just to make sure that your download is correcct: go to https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/fpspreadsheet/ and click on the "Download snapshot" button marked by a red rectangle
14
LCL / Re: Distance of gridlines in fpspreadsheet chart
« Last post by hajolo on Today at 05:43:36 pm »
Hello
I'm sorry, but I could not find a file fpSpreadsheetChart containing Mantisse.
Attached you find the zipped download file of fpspreadsheet/source/common using your link
https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/fpspreadsheet/
15
General / Re: How detect a keypress in a Windows program
« Last post by creaothceann on Today at 05:03:48 pm »
Here's a sample project of a checkers program with multithreading.

  • U_Form_Main: the GUI managed by the main thread
  • U_Game: the game state + code
  • U_WorkerThread: the thread that does an interruptible task
  • U_Common: some shared constants / types / code
EDIT: the SetSize function is probably broken for SetSize(0, 0), but for some reason there's no error message
16
WP is right. When I write my small bitmap arrays to screen I do this

Code: Pascal  [Select][+][-]
  1. var
  2. colorarray:array[0..31,0..23] of byte;
  3. x,y,r,c:integer;
  4.  
  5. begin
  6. // assuming something filled the colorarray
  7.  
  8. x := 100; y := 100;
  9.  
  10. for r := 0 to 31 do
  11.   for c := 0 to 23 do
  12.     putpixel(x+c,y+r,colorarray[r,c]);  // old school Borland graph routine
  13.  
  14. // also quite a bit faster is the use of a transparent color - I usually use 0 as the non displayed pixel, but it depends on the // palette I'm using, but for small "bitmaps" it's not that big of a deal. In your case it might be helpful if you aren't
  15. // animating the bitmap (if so then the area where the bitmap is being plotted has to be cleared first).
  16.  
  17. for r := 0 to 31 do
  18.    for c := 0 to 23 do
  19.      if colorarray[r,c] <> 0 then putpixel(x+c,r+y,colorarray[r,c]);
  20. end;
  21.  

And the other mentioned is the "page flipping" by writing to a canvas not viewed, then moving the whole canvas at once to the visual canvas. That's been a "trick" since the beginning of time.... 

17
Networking and Web Programming / Re: [SOLVED]FPHTTPServer with https
« Last post by DonAlfredo on Today at 04:25:17 pm »
Quote
this will be fixed in the next version of fpcupdeluxe
No, this will not be changed. The developers of FPC and Lazarus are against upgrading by overwriting the old version.
Just install a new version in its own directory with an appropriate name that indicates a version.
E.g.
FPC322LAZ42
FPCTRUNKLAZTRUNK
18
LCL / Re: Distance of gridlines in fpspreadsheet chart
« Last post by wp on Today at 04:14:48 pm »
As a Newbie of Linux and its package loading procedure...
This has nothing to do with Linux package loading: Just unzip the snapshot downloaded from the ccr page (link given above) into the same directory where your old FPSpreadsheet had been. To check that you have the newest version, you could load the file fpSpreadsheetChart and check whether you find a function Mantisse(x: Double): Double. If you don't you still have the old version.

And just to make sure that the modified units are compile you should rebuild the IDE: "Tools" > "Configure Build Lazarus" > check "Clean all" and "Switch to automatic after building" > "Build". Not absolutely necessary but this is one of the most effective ways to get up-to-date compiled units.
19
In my sample code you store your data directly in a 2D-array and then use this data array in a TRawImage as pixel matrix. A TBitmap has a method to load itself from such a RawImage, and then the image can easily painted by standard LCL functions. See attached demo.

Maybe one note (because I fell into this trap): If you are expecting the pixels in the image to be arranged such that x runs horizontally and y vertically the array must be declared in reverse order, array[y, x] (or array[y] of array[ x ] ) because the TRawImage wants the pixels to be arranged along the rows, or in other words, x must correspond to the right-most index of the 2d array.
20
General / Re: FPC v3.2.2 internal error
« Last post by Martin_fr on Today at 03:05:55 pm »
As indicated there is an issue comparing pointers. I had similar issues recently. Casting to PtrUInt or PtrInt **should** solve it.

Of course "internal error" still is a bug.

Maybe related to https://gitlab.com/freepascal.org/fpc/source/-/issues/41460 (I had tried the subtraction in a "const" section first... / but apparently any "pointer - pointer")
Pages: 1 [2] 3 4 ... 10

TinyPortal © 2005-2018