Picon

Re: Resizing an image

Hi Michael,

I am still confused. :-( I cannot figure out how to get the FPImage drawn. I thought perhaps the TImage.canvas.draw() function would do it - the code completion shows a draw(int, int, FPCustomImage) method, but when I compile it the compiler says it it expects a TGraphic. Sure enough, the TCanvas has one that expects TGraphic, and FPCanvas has one with FPCustomImage, but it is not marked as overloaded, so I think the compiler assumes it is not available.
I tried to find a way to get a TGraphic object from a FPCustomImage, but no success.

Thanks again for the help.
Charl

On 5/31/07, Charl van Jaarsveldt <charlvj <at> gmail.com> wrote:
Ah, that would probably explain why I can't find it. :-)

Yeah, I want to keep a cache of images in memory while keeping open the possibility of actually saving the cache. Thanks for the help!
Charl


On 5/31/07, Michael Van Canneyt <michael <at> freepascal.org > wrote:


On Thu, 31 May 2007, Charl van Jaarsveldt wrote:

> Thanks for the pointers. I can't find the extinterpolation unit though.

in the FPC source tree:

packages/fcl-image/src/extinterpolation.pp

(it may not be present if you're working with the the 2.0.4 release)

>
> I think I am getting an idea of how to do what I want. The only thing that
> eludes me is how to get the FPImage into the TImage control? The class
> hierarchy seems rather confusing there. :-(

If you just want to draw it, simply draw on the TImage canvas, that should work.

But TImage itself has resizing capabilities, the imgview demo shows how
to do this. The disadvantage is that you can't save the resized image,
as far as I know.

Michael.

>
> Thanks
> Charl
>
> PS Please excuse my ignorance, this is the first time I am working with
> images!
>
> On 5/31/07, Michael Van Canneyt <michael <at> freepascal.org> wrote:
> >
> >
> >
> > On Thu, 31 May 2007, Charl van Jaarsveldt wrote:
> >
> > > Hi,
> > >
> > > What is the best way to resize an image? I am thinking of something
> > Java's
> > > Image class has that will return a scaled image, and you can decide
> > whether
> > > it should be a good quality or a fast one. I don't necessarily want to
> > write
> > > it to a file, just in memory.  (I want to cache images in the memory and
> > so
> > > would like to have them much smaller than they are.)
> >
> > There are several resizing alogirthms present in FPC. see the
> > extinterpolation unit.
> > how it happens is: create a canvas, and draw the image on the canvas with
> > the correct
> > interpolation.
> >
> > If you want to create a new image in memory, create an TFPImageCanvas with
> > the desired
> > size, and draw the original canvas with the correct interpolation routine.
> >
> > Michael.
> >
> > _________________________________________________________________
> >      To unsubscribe: mail lazarus-request <at> miraclec.com with
> >                 "unsubscribe" as the Subject
> >    archives at http://www.lazarus.freepascal.org/mailarchives
> >
>
>
>
> --
> "I love deadlines. I especially love the whooshing sound they make as they
> fly by." - Douglas Adams
>

_________________________________________________________________
     To unsubscribe: mail lazarus-request <at> miraclec.com with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives



--
"I love deadlines. I especially love the whooshing sound they make as they fly by." - Douglas Adams



--
"I love deadlines. I especially love the whooshing sound they make as they fly by." - Douglas Adams
Carlos Avogaro | 1 Jun 02:21
Picon
Favicon

Re: Wince Crossbin utils windows installer don't works

Hi patrick
 
where I can find the pocket pc emulator ?
 
Thank you

patrick feillant <patrick <at> feillant.com> wrote:
Hello
 I install today,
Lazarus-0.9.23-fpc-2.1.5-20070531-win32.exe
Lazarus-0.9.23-fpc-2.1.5-20070531-cross-arm-wince-win32.exe (i see in your mail here that it exist !!)
Is the Cross-arm-wince make every day , is not accessible in the snapshots.
 
I test my prog on pocket pc emulator, it'is ok.
 
Another question, i try to access with SVN to the trunc as ask to me for download source wince, i don't have any user and password, what is the procedure. Finally your mai l permit me to update my configuration.
 
Thanks
 


 
2007/5/31, Vincent Snijders <vsnijders <at> quicknet.nl>:
alvise.nicoletti <at> siteland.it schreef:
> Hi ;)
>
> I just downloaded and installed the new lazarus+crosswince but they don't
> works.
>
> The file I downloaded are:
> Lazarus-0.9.23-fpc-2.1.3-20070424-win32.exe
> Lazarus-0.9.23-fpc-2.1.3-20070422-cross-arm-wince-win32.exe
>
> After installing, I opened lazarus and pressed F9 to compile a idle
> project, it worked.
>
> After changing target os and cpu to wince and arm (in al the three
> comboboxes), I pressed control + f9 and got this errors:
> project1.lpr(19) Warning: Object wincemenures.or not found, Linking may
> fail !
> project1.lpr(19) Warning: Object wincemenures.or not found, Linking may
> fail !
> project1.lpr(19) Error: Can't open object file: wincemenures.or
> project1.lpr(19) Fatal: There were 1 errors compiling module, stopping
>

I have uploaded a new arm-wince cross installer. In this version (with fpc 2.1.5)
this bug has been fixed.

You can download it from
ftp://ftp.hu.freepascal.org/pub/lazarus/cross

Vincent

_________________________________________________________________
    To unsubscribe: mail lazarus-request <at> miraclec.com with
               "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us.
Picon

Re: Lazarus for win64 available for download from sourceforge

Hi,my name is German Tejero, and my english is very bad.
 
I download the lazarus win64 release, and i test it on a Intel Core 2 Duo E6400.
I install the lazdaemon package and i discover a bug, when add a TDaemon or a TDaemonMapper, the uses contains duplicated LResources unit:
 
  uses
  Classes, SysUtils, LResources, LResources, daemonapp;
the bug is in the reglazdaemon unit:
...
function TDaemonFileDescriptor.GetInterfaceUsesSection: String;
begin
  Result:=inherited GetInterfaceUsesSection+', LResources, daemonapp';
end;     
...
function TDaemonMapperDescriptor.GetInterfaceUsesSection: String;
begin
  Result:=inherited GetInterfaceUsesSection+', LResources, daemonapp';
end;  
...
 
Bye.
German.
 
2007/5/31, Vincent Snijders <vsnijders <at> quicknet.nl>:
The win64 versions of fpc and Lazarus have improved a lot in the last
couple of months. So much that we can include it in the regular releases
when fpc 2.2.0 has been released (expected this summer).

To celebrate this, the Lazarus team has uploaded a snapshot to the
Lazarus testing download area on Sourceforge:
http://sourceforge.net/project/showfiles.php?group_id=89339&package_id=93599

Main differences between the win32 and win64 version:
* No debugger support in win64 (there is no gdb for win64).
* No resource support, so no default icon for example and no windows xp
look, due to missing manifest (gnu's windres doesn't support win64)
* Lazarus for windows 64 is less used and tested, so a lot of components
and packages may not work (for example LazReport). Create bug reports
for things you have noticed.

This installer can be seen as a release candidate for the first official
Lazarus release with win64, which will probably made a couple of weeks
after the fpc 2.2.0 release.

The main purpose of this announcement and the upload to sourceforge is
to attract more people who can test this lazarus version. Please use the
bugtracker http://www.freepascal.org/mantis/set_project.php?project_id=1
if you notice bugs that are not in the win32 version.

Vincent

_________________________________________________________________
    To unsubscribe: mail lazarus-request <at> miraclec.com with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives



--
Carlos Germán Tejero
Jesus Reyes A. | 1 Jun 06:26
Picon
Favicon

Re: About DBGRid+ZEOS in Suse


----- Original Message ----- 
From: "Allies Xposs" <allies_xposs <at> yahoo.com>
To: <lazarus <at> miraclec.com>
Sent: Tuesday, May 22, 2007 11:47 PM
Subject: [lazarus] About DBGRid+ZEOS in Suse

> Need Help....
>  In my DBGRID dataset with ZSquery (Zeos Component) can not show Record 
> (Varchar (4)), But Field Date (P_tgl Date) can Show record data   (Record 
> Blank). Why ?
>  But in Script mysql can Show record :
>  Mysql > Select * from Kelompok
>
>  ------------------------------------------------------------
>  | p_kode | P_Nama        |P_tgl
>  ---------------------------------------------------------
>  | 001      | desc 001       | 2007-05-05
>
>  --------------------------------------------------
>  ...
>  Pls help me .....
>

Sounds similar to this one http://www.freepascal.org/mantis/view.php?id=8731 
which I still can't reproduce.

Jesus Reyes A. 

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.com.mx/ 

Vincent Snijders | 1 Jun 08:50
Picon
Favicon

Re: Lazarus for win64 available for download from sourceforge

Carlos German Tejero schreef:
> Hi,my name is German Tejero, and my english is very bad.
>  
> I download the lazarus win64 release, and i test it on a Intel Core 2 
> Duo E6400.
> I install the lazdaemon package and i discover a bug, when add a TDaemon 
> or a TDaemonMapper, the uses contains duplicated LResources unit:
>  
> *  uses
>   Classes, SysUtils, LResources, LResources, daemonapp;
> *
> the bug is in the reglazdaemon unit:
> ...
> function TDaemonFileDescriptor.GetInterfaceUsesSection: String;
> begin
>   Result:=inherited GetInterfaceUsesSection+', LResources, daemonapp';
> end;     
> ...
> function TDaemonMapperDescriptor.GetInterfaceUsesSection: String;
> begin
>   Result:=inherited GetInterfaceUsesSection+', LResources, daemonapp';
> end;  
> ...
>  

Thanks for the report. I wonder why nobody else noticed this before. Did 
anybody try out this component at all?

Fixed in r11249 (SVN).

Vincent

A.J. Venter | 1 Jun 08:55
Picon
Gravatar

Re: Resizing an image

Hi Michael,
Here is how I do it [I'm sure you can customise it to your needs,
factor can also be something like 0.5 (to scale to halfsize)] :)

A.J.

Procedure Scale(P1 : TPicture;Var P2:TPicture;Factor : Real);
Var
	ARect : TRect;
	X,Y : Integer;
Begin
X := Round(P1.Width * Factor);
Y := Round(P1.Height * Factor);
P2.Clear;
P2.BitMap.Width := X;
P2.BitMap.Height := Y;
Arect := Rect(0,0,X,Y);
P2.BitMap.Canvas.StretchDraw(ARect,P1.BitMap);
end;

On 6/1/07, Charl van Jaarsveldt <charlvj <at> gmail.com> wrote:
> Hi Michael,
>
> I am still confused. :-( I cannot figure out how to get the FPImage drawn. I
> thought perhaps the TImage.canvas.draw() function would do it - the code
> completion shows a draw(int, int, FPCustomImage) method, but when I compile
> it the compiler says it it expects a TGraphic. Sure enough, the TCanvas has
> one that expects TGraphic, and FPCanvas has one with FPCustomImage, but it
> is not marked as overloaded, so I think the compiler assumes it is not
> available.
> I tried to find a way to get a TGraphic object from a FPCustomImage, but no
> success.
>
> Thanks again for the help.
> Charl
>
>
> On 5/31/07, Charl van Jaarsveldt <charlvj <at> gmail.com> wrote:
> > Ah, that would probably explain why I can't find it. :-)
> >
> > Yeah, I want to keep a cache of images in memory while keeping open the
> possibility of actually saving the cache. Thanks for the help!
> > Charl
> >
> >
> >
> > On 5/31/07, Michael Van Canneyt <michael <at> freepascal.org > wrote:
> > >
> > >
> > > On Thu, 31 May 2007, Charl van Jaarsveldt wrote:
> > >
> > > > Thanks for the pointers. I can't find the extinterpolation unit
> though.
> > >
> > > in the FPC source tree:
> > >
> > > packages/fcl-image/src/extinterpolation.pp
> > >
> > > (it may not be present if you're working with the the 2.0.4 release)
> > >
> > > >
> > > > I think I am getting an idea of how to do what I want. The only thing
> that
> > > > eludes me is how to get the FPImage into the TImage control? The class
> > > > hierarchy seems rather confusing there. :-(
> > >
> > > If you just want to draw it, simply draw on the TImage canvas, that
> should work.
> > >
> > > But TImage itself has resizing capabilities, the imgview demo shows how
> > > to do this. The disadvantage is that you can't save the resized image,
> > > as far as I know.
> > >
> > > Michael.
> > >
> > > >
> > > > Thanks
> > > > Charl
> > > >
> > > > PS Please excuse my ignorance, this is the first time I am working
> with
> > > > images!
> > > >
> > > > On 5/31/07, Michael Van Canneyt <michael <at> freepascal.org> wrote:
> > > > >
> > > > >
> > > > >
> > > > > On Thu, 31 May 2007, Charl van Jaarsveldt wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > What is the best way to resize an image? I am thinking of
> something
> > > > > Java's
> > > > > > Image class has that will return a scaled image, and you can
> decide
> > > > > whether
> > > > > > it should be a good quality or a fast one. I don't necessarily
> want to
> > > > > write
> > > > > > it to a file, just in memory.  (I want to cache images in the
> memory and
> > > > > so
> > > > > > would like to have them much smaller than they are.)
> > > > >
> > > > > There are several resizing alogirthms present in FPC. see the
> > > > > extinterpolation unit.
> > > > > how it happens is: create a canvas, and draw the image on the canvas
> with
> > > > > the correct
> > > > > interpolation.
> > > > >
> > > > > If you want to create a new image in memory, create an
> TFPImageCanvas with
> > > > > the desired
> > > > > size, and draw the original canvas with the correct interpolation
> routine.
> > > > >
> > > > > Michael.
> > > > >
> > > > >
> _________________________________________________________________
> > > > >      To unsubscribe: mail lazarus-request <at> miraclec.com with
> > > > >                 "unsubscribe" as the Subject
> > > > >    archives at
> http://www.lazarus.freepascal.org/mailarchives
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > "I love deadlines. I especially love the whooshing sound they make as
> they
> > > > fly by." - Douglas Adams
> > > >
> > >
> > >
> _________________________________________________________________
> > >      To unsubscribe: mail lazarus-request <at> miraclec.com with
> > >                 "unsubscribe" as the Subject
> > >    archives at
> http://www.lazarus.freepascal.org/mailarchives
> > >
> >
> >
> >
> > --
> > "I love deadlines. I especially love the whooshing sound they make as they
> fly by." - Douglas Adams
>
>
>
> --
>
> "I love deadlines. I especially love the whooshing sound they make as they
> fly by." - Douglas Adams

--

-- 
A.J. Venter
CEO - OutKast Solutions C.C.
http://www.outkastsolutions.co.za
Cell: +27 83 455 9978
Fax: +27 21 413 2800
Office: +27 21 591 6766

patrick feillant | 1 Jun 09:23

Re: Wince Crossbin utils windows installer don't works

hello
try this, free download with image os
http://www.microsoft.com/downloads/details.aspx?FamilyId=C62D54A5-183A-4A1E-A7E2-CC500ED1F19A&displaylang=en

Then i write in another message

"

When you run your emulateur, you give the repertorie witch is shared between lazarus (compile exe) and the emulator.
ex : "C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe"  pocketpc.nb0 /skin Pocket_PC.xml /memsize 128 /sharedfolder C:\LzProjet\man\
 
Here i lunch the emulator with
image Os Wince : pocketpc.nb0 (same directorie as exe of emulator)
Picture of the pocket Pc model : /skin pocket_pc.xml  (one in the emulator install)
size of Ram : /memsize 128 (for exemple 128 meg)
directorie share : /sharefolder C:\LzProjet\man\  ( my lazarus project is, and for exemple with an test.exe
 
You compile under lazarus to have a test.exe
 
Under the emulator, you lunch "file explorator" (programs), and you go to "Sd card", your Sd Card is the shared directorie.
You click on test.exe.
 
You had to stop the run each time before recompile, or the file will be  busy (test.exe used by emulator). The (X) on the rigth of the windows don't stop the run on pocket pc, you must stop the run by a button witch close the main window. (or you stop the process under system / memory / stop process.
 
I also access to the web under the emulator, test that in a first time.
bye.
Patrick from France, excuse me for my english..
 "
For web access in the emulator, i have made a somes succesfulls test with the Lnet package of Ales in wince.
I can give you the solutions if you need for the connexion of the emulator to the web with ActiveSync if you now. (i find a very simple solution on the web).
All that is on Windows.

I'll like to test all that on Ubuntu 7.04 with Wine for the emulator, but i don't know today if it's possible to run Cross compiler wince on linux i386.

i'll make an inventory of all the problems i detect on wince, there are many simple screen objects then don't run correctly (i declare in bug tracker).

I hope respond to yours answers.
bye

2007/6/1, Carlos Avogaro <avoinfo <at> yahoo.com>:
Hi patrick
 
where I can find the pocket pc emulator ?
 
Thank you


patrick feillant < patrick <at> feillant.com> wrote:
Hello
 I install today,
Lazarus-0.9.23-fpc-2.1.5-20070531-win32.exe
Lazarus-0.9.23-fpc-2.1.5-20070531-cross-arm-wince-win32.exe (i see in your mail here that it exist !!)
Is the Cross-arm-wince make every day , is not accessible in the snapshots.
 
I test my prog on pocket pc emulator, it'is ok.
 
Another question, i try to access with SVN to the trunc as ask to me for download source wince, i don't have any user and password, what is the procedure. Finally your mail permit me to update my configuration.
 
Thanks
 


 
2007/5/31, Vincent Snijders <vsnijders <at> quicknet.nl >:
alvise.nicoletti <at> siteland.it schreef:
> Hi ;)
>
> I just downloaded and installed the new lazarus+crosswince but they don't
> works.
>
> The file I downloaded are:
> Lazarus-0.9.23-fpc-2.1.3-20070424-win32.exe
> Lazarus-0.9.23-fpc-2.1.3-20070422-cross-arm-wince-win32.exe
>
> After installing, I opened lazarus and pressed F9 to compile a idle
> project, it worked.
>
> After changing target os and cpu to wince and arm (in al the three
> comboboxes), I pressed control + f9 and got this errors:
> project1.lpr(19) Warning: Object wincemenures.or not found, Linking may
> fail !
> project1.lpr(19) Warning: Object wincemenures.or not found, Linking may
> fail !
> project1.lpr(19) Error: Can't open object file: wincemenures.or
> project1.lpr (19) Fatal: There were 1 errors compiling module, stopping
>

I have uploaded a new arm-wince cross installer. In this version (with fpc 2.1.5)
this bug has been fixed.

You can download it from
ftp://ftp.hu.freepascal.org/pub/lazarus/cross

Vincent

_________________________________________________________________
    To unsubscribe: mail lazarus-request <at> miraclec.com with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us.


Graeme Geldenhuys | 1 Jun 10:11
Picon
Gravatar

new Thread Manager Demo

Hi,

I'm busy writing a Thread Manager demo in Lazarus to help me
understanding threads better. This demo will then serve as a good
example of how to use threads and synchronization. No better way to
learn something than writing code! :)

A quick summary of what I want to do:
-------------------------------------------------------
* You can create a Sync Object by selecting one of the following
types: No Synchronization, Critical Section, Mutex or Semaphore.

* Then you can create as many threads as you want. Default thread
priority is Normal. Each thread counts down from 100% to 0% at which
point the thread is completed.

* A grid will show you all the threads you created. Each grid line
represents a thread.

* You can Stop, Resume or Kill an individual thread.

* You can change an individual thread's Priority (tpIdle thru
tpTimeCritical), though under Linux I know the thread priority is a
integer value. tpXXX values will be displayed in the grid.

* You can also act on all threads: Kill All, Stop All and Resume All.

Questions:
------------------
1. Is there any other synchronization methods that FPC supports?

2. Is there a platform independent way of creating a Mutex? eg: A
CreateMutex() function that maps to each platforms specific
implementation. Something like the TCriticalSection class.

3. Same as (2), but for Semaphores.

--

-- 
Graeme Geldenhuys
General error, hit any user to continue.

Luca Olivetti | 1 Jun 10:37
Picon
Gravatar

Re: new Thread Manager Demo

En/na Graeme Geldenhuys ha escrit:

> Questions:
> ------------------
> 1. Is there any other synchronization methods that FPC supports?
> 
> 2. Is there a platform independent way of creating a Mutex? eg: A
> CreateMutex() function that maps to each platforms specific
> implementation. Something like the TCriticalSection class.

Don't know an answer to these questions but beware: if you use 
TEventObject, the only valid value for timeout in the WaitFor method is 
$FFFFFFFF (i.e. wait forever) under linux.

Bye
--

-- 
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004      Fax +34 93 5883007

Alvise Nicoletti | 1 Jun 10:54
Picon

Re: new Thread Manager Demo

Graeme Geldenhuys ha scritto:
> Hi,
>
> I'm busy writing a Thread Manager demo in Lazarus to help me
> understanding threads better. This demo will then serve as a good
> example of how to use threads and synchronization. No better way to
> learn something than writing code! :)
>
> A quick summary of what I want to do:
> -------------------------------------------------------
> * You can create a Sync Object by selecting one of the following
> types: No Synchronization, Critical Section, Mutex or Semaphore.
>
> * Then you can create as many threads as you want. Default thread
> priority is Normal. Each thread counts down from 100% to 0% at which
> point the thread is completed.
>
> * A grid will show you all the threads you created. Each grid line
> represents a thread.
>
> * You can Stop, Resume or Kill an individual thread.
>
> * You can change an individual thread's Priority (tpIdle thru
> tpTimeCritical), though under Linux I know the thread priority is a
> integer value. tpXXX values will be displayed in the grid.
>
> * You can also act on all threads: Kill All, Stop All and Resume All.
>
>
> Questions:
> ------------------
> 1. Is there any other synchronization methods that FPC supports?
>
> 2. Is there a platform independent way of creating a Mutex? eg: A
> CreateMutex() function that maps to each platforms specific
> implementation. Something like the TCriticalSection class.
>
> 3. Same as (2), but for Semaphores.
>
>
That would be great ;)

Actually I managed to use base threads, but I'd like to do some cooler 
things with them.


Gmane