Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-28 Thread José Mejuto

El 28/06/2017 a las 23:50, James Richters escribió:

The two color schemes are nothing alike.  16bit is using this RGB565 format, 
but 8bit colors (at least the version I was using) the colors have no real 
relation to their bits (see thishttps://pasteboard.co/2K38l6Gk1.png)  I can't 
figure out any pattern to this at all and while some colors I can figure out, 
others would be quite difficult.


Hello,

Your palette looks like standard Int Mode 13h VGA palette (yes, I'm 
older). This are the RGB values (I'm quite sure):


palette[  0] = rgb(  0,  0,  0)
palette[  1] = rgb(  0,  0,170)
palette[  2] = rgb(  0,170,  0)
palette[  3] = rgb(  0,170,170)
palette[  4] = rgb(170,  0,  0)
palette[  5] = rgb(170,  0,170)
palette[  6] = rgb(170, 85,  0)
palette[  7] = rgb(170,170,170)
palette[  8] = rgb( 85, 85, 85)
palette[  9] = rgb( 85, 85,255)
palette[ 10] = rgb( 85,255, 85)
palette[ 11] = rgb( 85,255,255)
palette[ 12] = rgb(255, 85, 85)
palette[ 13] = rgb(255, 85,255)
palette[ 14] = rgb(255,255, 85)
palette[ 15] = rgb(255,255,255)
palette[ 16] = rgb(  0,  0,  0)
palette[ 17] = rgb( 20, 20, 20)
palette[ 18] = rgb( 32, 32, 32)
palette[ 19] = rgb( 44, 44, 44)
palette[ 20] = rgb( 56, 56, 56)
palette[ 21] = rgb( 68, 68, 68)
palette[ 22] = rgb( 80, 80, 80)
palette[ 23] = rgb( 97, 97, 97)
palette[ 24] = rgb(113,113,113)
palette[ 25] = rgb(129,129,129)
palette[ 26] = rgb(145,145,145)
palette[ 27] = rgb(161,161,161)
palette[ 28] = rgb(182,182,182)
palette[ 29] = rgb(202,202,202)
palette[ 30] = rgb(226,226,226)
palette[ 31] = rgb(255,255,255)
palette[ 32] = rgb(  0,  0,255)
palette[ 33] = rgb( 64,  0,255)
palette[ 34] = rgb(125,  0,255)
palette[ 35] = rgb(190,  0,255)
palette[ 36] = rgb(255,  0,255)
palette[ 37] = rgb(255,  0,190)
palette[ 38] = rgb(255,  0,125)
palette[ 39] = rgb(255,  0, 64)
palette[ 40] = rgb(255,  0,  0)
palette[ 41] = rgb(255, 64,  0)
palette[ 42] = rgb(255,125,  0)
palette[ 43] = rgb(255,190,  0)
palette[ 44] = rgb(255,255,  0)
palette[ 45] = rgb(190,255,  0)
palette[ 46] = rgb(125,255,  0)
palette[ 47] = rgb( 64,255,  0)
palette[ 48] = rgb(  0,255,  0)
palette[ 49] = rgb(  0,255, 64)
palette[ 50] = rgb(  0,255,125)
palette[ 51] = rgb(  0,255,190)
palette[ 52] = rgb(  0,255,255)
palette[ 53] = rgb(  0,190,255)
palette[ 54] = rgb(  0,125,255)
palette[ 55] = rgb(  0, 64,255)
palette[ 56] = rgb(125,125,255)
palette[ 57] = rgb(157,125,255)
palette[ 58] = rgb(190,125,255)
palette[ 59] = rgb(222,125,255)
palette[ 60] = rgb(255,125,255)
palette[ 61] = rgb(255,125,222)
palette[ 62] = rgb(255,125,190)
palette[ 63] = rgb(255,125,157)
palette[ 64] = rgb(255,125,125)
palette[ 65] = rgb(255,157,125)
palette[ 66] = rgb(255,190,125)
palette[ 67] = rgb(255,222,125)
palette[ 68] = rgb(255,255,125)
palette[ 69] = rgb(222,255,125)
palette[ 70] = rgb(190,255,125)
palette[ 71] = rgb(157,255,125)
palette[ 72] = rgb(125,255,125)
palette[ 73] = rgb(125,255,157)
palette[ 74] = rgb(125,255,190)
palette[ 75] = rgb(125,255,222)
palette[ 76] = rgb(125,255,255)
palette[ 77] = rgb(125,222,255)
palette[ 78] = rgb(125,190,255)
palette[ 79] = rgb(125,157,255)
palette[ 80] = rgb(182,182,255)
palette[ 81] = rgb(198,182,255)
palette[ 82] = rgb(218,182,255)
palette[ 83] = rgb(234,182,255)
palette[ 84] = rgb(255,182,255)
palette[ 85] = rgb(255,182,234)
palette[ 86] = rgb(255,182,218)
palette[ 87] = rgb(255,182,198)
palette[ 88] = rgb(255,182,182)
palette[ 89] = rgb(255,198,182)
palette[ 90] = rgb(255,218,182)
palette[ 91] = rgb(255,234,182)
palette[ 92] = rgb(255,255,182)
palette[ 93] = rgb(234,255,182)
palette[ 94] = rgb(218,255,182)
palette[ 95] = rgb(198,255,182)
palette[ 96] = rgb(182,255,182)
palette[ 97] = rgb(182,255,198)
palette[ 98] = rgb(182,255,218)
palette[ 99] = rgb(182,255,234)
palette[100] = rgb(182,255,255)
palette[101] = rgb(182,234,255)
palette[102] = rgb(182,218,255)
palette[103] = rgb(182,198,255)
palette[104] = rgb(  0,  0,113)
palette[105] = rgb( 28,  0,113)
palette[106] = rgb( 56,  0,113)
palette[107] = rgb( 85,  0,113)
palette[108] = rgb(113,  0,113)
palette[109] = rgb(113,  0, 85)
palette[110] = rgb(113,  0, 56)
palette[111] = rgb(113,  0, 28)
palette[112] = rgb(113,  0,  0)
palette[113] = rgb(113, 28,  0)
palette[114] = rgb(113, 56,  0)
palette[115] = rgb(113, 85,  0)
palette[116] = rgb(113,113,  0)
palette[117] = rgb( 85,113,  0)
palette[118] = rgb( 56,113,  0)
palette[119] = rgb( 28,113,  0)
palette[120] = rgb(  0,113,  0)
palette[121] = rgb(  0,113, 28)
palette[122] = rgb(  0,113, 56)
palette[123] = rgb(  0,113, 85)
palette[124] = rgb(  0,113,113)
palette[125] = rgb(  0, 85,113)
palette[126] = rgb(  0, 56,113)
palette[127] = rgb(  0, 28,113)
palette[128] = rgb( 56, 56,113)
palette[129] = rgb( 68, 56,113)
palette[130] = rgb( 85, 56,113)
palette[131] = rgb( 97, 56,113)
palette[132] = rgb(113, 56,113)
palette[133] = rgb(113, 56, 97)
palette[134] = rgb(113, 56, 85)
palette[135] = rgb(113, 56, 68)
palette[136] = rgb(113, 56, 56)
palette[137] = rgb(113, 68, 56)
palette[138] = rgb(113, 85, 56)
palette[139] = 

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-28 Thread James Richters
I've figured out a way to get my animations to work fast and still have the 
quality of aggpas.  The problem I have is that even though I've managed to 
accelerate putimage() and it's pretty fast, it's still not fast enough and my 
animations in my program happen too slow, especially on slow computers.  I can 
build the screen fast with aggpas, and I can do putimage() pretty fast, but for 
some reason making a change with aggpas then putimage, then change aggpas then 
putimage... is slower.  So I came up with a solution.  I do the animations with 
ptcgraph commands at the same time I build the screen with aggpas, then when 
the animation is finished, I do my putimage() and replace the screen with the 
aggpas rendered version.  It works out that during the animation, the screen is 
changing distractingly fast that you really don't notice the lower quality 
graphics produced by ptcgraph routines, and when it stops and now you have a 
chance to look a it, the screen has been replaced with the aggpas version so 
everything looks nice and smooth    With this method I actually had to put a 
delay in my animation cycle or it was too fast and I lost the animation effect 
I was looking for.   

Now I'm ready to start integrating everything I learned into my real 
application and I have a question.
My original application used only 8bit colors, but now I am upgrading it to 
16bit colors because it will give aggpas more to work with for it's 
anti-aliasing.   Is there some formula or maybe even some function in 
freepascal somewhere that converts 8bit colors to their 16bit equivalents?   
The two color schemes are nothing alike.  16bit is using this RGB565 format, 
but 8bit colors (at least the version I was using) the colors have no real 
relation to their bits (see this https://pasteboard.co/2K38l6Gk1.png)  I can't 
figure out any pattern to this at all and while some colors I can figure out, 
others would be quite difficult.  I'm wondering if maybe there is already some 
translation from these 8bit color designations into 16bit color designations so 
all I would have to do is a global search and replace of setcolor(x) to 
setcolor(8bit_to_16bit(x)); and then all my colors would be the same as they 
were.

I'm also wondering if there is already some function to either convert the 
16bit RGB565 colors into separate 8bit values of red, green, and blue suitable 
to plug into aggpas procedures like 
agg^.lineColor(red, green, blue, 255);  I could probably manage something for 
this because it's pretty well defined that I have 5bits red, 6 bits green, and 
5 bits blue, but still I'm not exactly clear how it would get from 5 or 6 bits 
up to 8 bits per color...  but if it's already available somewhere I might as 
well use what's done already.

James


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Can't close and reopen ptcgraph

2017-06-28 Thread James Richters
>add  ptcwrapper to uses list.
Thank you,  that worked!

James

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Can't close and reopen ptcgraph

2017-06-28 Thread Stefan V. Pantazi

add  ptcwrapper to uses list.



I get reopengraph.pas(32,23) Error: Identifier not found "TPTCWrapperThread"


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Running Freepascal programs on other computers

2017-06-28 Thread James Richters
>Are you by chance running it from a shared smb folder or something like that? 

Yes I am running them on a network share… If I copy the file to my laptop hard 
drive then I don’t get the warning anymore.  However I still get the secutiy 
warning if the program is downloaded, even if I download it to the original 
development pc.

 

>I'm not a Windows developer, but You have to code sign your executable, 
>probably, just like any normal Windows app you'd release. Does this 
>Stackoverflow link provide any help?

>https://stackoverflow.com/questions/252226/signing-a-windows-exe-file

 

Thank you for the link, that does help explain things and gets me pointed in 
the right direction.  

 

 

James

 

 

From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
Snorkl e
Sent: Wednesday, June 28, 2017 1:51 PM
To: FPC-Pascal users discussions 
Subject: Re: [fpc-pascal] Running Freepascal programs on other computers

 

Are you by chance running it from a shared smb folder or something like that?  
I run all my fpc apps on Windows 10, but from a local drive and don't get 
warnings.

 

On Jun 28, 2017 11:56 AM, "James Richters"  > wrote:

When I run any freepascal program that I compiled on my windows 10 desktop 
computer on any other PC, I always get a warning:

We could not verify who created this file, are you sure you want to run this 
file? 

 

When I search for a way to fix this, I get a bunch of results telling how to 
bypass the windows protection and let the file run without the warning, but I 
don’t see any results on how to actually properly take care of this, so the 
program actually CAN be properly verified and run without the warning and 
without modifying the windows installation.   

 

Does anyone know how this is normally achieved, and how to implement this with 
my freepascal console applications?

 

James

 


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org 
 
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

 

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Can't close and reopen ptcgraph

2017-06-28 Thread James Richters
I thought I would try to get my demo program to work.  When I try to compile it 
with

//manually create the ptcwrapper thread
PTCWrapperObject := TPTCWrapperThread.Create;

I get reopengraph.pas(32,23) Error: Identifier not found "TPTCWrapperThread"

Demo program below... Any ideas?

James

{$mode objfpc}{$H+}
program ReOpenGraph.pas;
uses
  ptcgraph,ptccrt;
var
  gd,gm : smallint;

begin
  gd:=d8Bit;
  gm:=m800x600;
  Writeln('Opening Graphics Window');
  Initgraph(gd,gm,'');
  Writeln('Graphics Window Open');
  setcolor($4A);
  settextstyle(Defaultfont,HORIZDIR,2);
  outtextxy(30,30,'Graphics Window Open');
  readkey;
  //close graph window
  Closegraph;
  //manually terminate the ptcwrapper thread and free object
  PTCWrapperObject.Terminate;
  PTCWrapperObject.WaitFor;
  PTCWrapperObject.Free;
  Writeln('Closing Graphics Window');
  readln;
  Writeln('Create ptcwrapper thread');
  //manually create the ptcwrapper thread
  PTCWrapperObject := TPTCWrapperThread.Create; //compiler error 
  Writeln('Re-Opening Graphics Window');
  //init graph windows as usual
  Initgraph(gd,gm,''); // window opens then closes immediately with ptcgraph
  Writeln('Graphics Window Open Again'); // this never happens with ptcgraph
  setcolor($4A);
  settextstyle(Defaultfont,HORIZDIR,2);
  outtextxy(30,30,'Graphics Window Open Again');
  Readln;
  Closegraph;
end.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-06-28 Thread turro75
I don't know if useful, here You can find a terminal + serial to eth or
reversed based on lnet, custom serial component and richmemo

https://github.com/Turro75/TCPLogger_V2.git
  

Ciao

Valerio



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Serial-to-TCP-gateway-in-FPC-tp5729097p5729176.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Running Freepascal programs on other computers

2017-06-28 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Wed, 28 Jun 2017, James Richters wrote:

> Does anyone know how this is normally achieved, and how to implement
> this with my freepascal console applications?

I'm not a Windows developer, but You have to code sign your executable,
probably, just like any normal Windows app you'd release. Does this
Stackoverflow link provide any help?

https://stackoverflow.com/questions/252226/signing-a-windows-exe-file

Charlie
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Running Freepascal programs on other computers

2017-06-28 Thread Snorkl e
Are you by chance running it from a shared smb folder or something like
that?  I run all my fpc apps on Windows 10, but from a local drive and
don't get warnings.

On Jun 28, 2017 11:56 AM, "James Richters" 
wrote:

When I run any freepascal program that I compiled on my windows 10 desktop
computer on any other PC, I always get a warning:

We could not verify who created this file, are you sure you want to run
this file?



When I search for a way to fix this, I get a bunch of results telling how
to bypass the windows protection and let the file run without the warning,
but I don’t see any results on how to actually properly take care of this,
so the program actually CAN be properly verified and run without the
warning and without modifying the windows installation.



Does anyone know how this is normally achieved, and how to implement this
with my freepascal console applications?



James



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Running Freepascal programs on other computers

2017-06-28 Thread James Richters
When I run any freepascal program that I compiled on my windows 10 desktop
computer on any other PC, I always get a warning:

We could not verify who created this file, are you sure you want to run this
file? 

 

When I search for a way to fix this, I get a bunch of results telling how to
bypass the windows protection and let the file run without the warning, but
I don't see any results on how to actually properly take care of this, so
the program actually CAN be properly verified and run without the warning
and without modifying the windows installation.   

 

Does anyone know how this is normally achieved, and how to implement this
with my freepascal console applications?

 

James

 

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal