Recent

Author Topic: Lazarus Win CE HTC (VGA resolution)  (Read 12867 times)

zoh

  • Newbie
  • Posts: 3
Lazarus Win CE HTC (VGA resolution)
« on: October 13, 2009, 12:22:48 pm »
Hello

Few days ago i start my adventure with Lazarus And WinCE (before i use Delphi to write programs on Win32)

I have HTC Touch Pro and it have VGA resolution screen.
When I compile project it is in 240x320 res.

How i can compile project to another resolution (e.g.480x800)

best regards

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2507
Re: Lazarus Win CE HTC (VGA resolution)
« Reply #1 on: October 13, 2009, 12:35:37 pm »
?? the last time I compiled something for my omnia there wasn't a sceen limit
what did you design, how was the form look like ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

zoh

  • Newbie
  • Posts: 3
Re: Lazarus Win CE HTC (VGA resolution)
« Reply #2 on: October 13, 2009, 01:38:52 pm »
meybe i do something wrong...

i start lazarus -> file -> new -> application
i change compiler to WinCE, i put 2 controls on form (button, label)

some source:

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  label1.caption:=inttostr(x)+' '+inttostr(y);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  close;
end;  


compile, put into PDA and max values is 320x240 ;/

i try chcange Form.autosize, Form.BorderStyle, Form.BorderIcons, Caption, set Constraints
still i have 240x320 ;/

in compiler i have LCL widget - winCe (beta)

what i must change??



BlueIcaro

  • Hero Member
  • *****
  • Posts: 584
Re: Lazarus Win CE HTC (VGA resolution)
« Reply #3 on: October 14, 2009, 05:13:06 pm »
Did you try to specify plataform?
Quote
The Windows CE interface will try to automatically detect the kind of device which is being run if nothing is specifyed by the user. The possible devices are:

    * atDefault - The same as atPDA
    * atPDA - A PDA with a touch screen. Forms are usually maximized to ocupy the whole work area, and custom positioning and sizing is ignored. Windows CE devices will almost always (maybe always?) have a Width of 240 pixels, and the Height can very, but 320 pixels is a good guess.
    * atSmartphone - Similar to a PDA, but can be used as a phone. Currently no technical difference to atPDA.
    * atDesktop - A full desktop application, for which the operating system just happens to be WinCE. Should work just like the Win32 Lazarus interface.
    * atHandheld - Bigger then a PDA and with more capability. Currently is the same as atDesktop.

How to specify a fixed device:

 
program MyProgram;
 
...
 
begin
  Application.ApplicationType := atSmartphone;
  // On Application.Initialize a default device would be detected if
  // ApplicationType = atDefault, but now the detection is suppressed.
  Application.Initialize;
  ...
end.
 
Taken from wiki: http://wiki.lazarus.freepascal.org/Windows_CE_Development_Notes#Platform_specific_Tips
/BlueIcaro
Remenber, the lazarus wiki is your friend: http://wiki.lazarus.freepascal.org/Main_Page
General questions (several lenguages) http://wiki.lazarus.freepascal.org/

zoh

  • Newbie
  • Posts: 3
Re: Lazarus Win CE HTC (VGA resolution)
« Reply #4 on: October 15, 2009, 01:58:35 pm »
hello

i try this settings - still 240x320

i guess it depends on compilator. in visual studio is option to set resolution.

regards

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2507
Re: Lazarus Win CE HTC (VGA resolution)
« Reply #5 on: October 15, 2009, 02:09:42 pm »
the compiler has no influence on this.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Lazarus Win CE HTC (VGA resolution)
« Reply #6 on: October 20, 2009, 03:15:55 pm »
Do you have a screenshot of this problem? You could help searching which Windows API call is necessary to change the device resolution.

Chainfire

  • New Member
  • *
  • Posts: 28
Re: Lazarus Win CE HTC (VGA resolution)
« Reply #7 on: November 10, 2009, 12:41:33 pm »
Windows Mobile runs all software in 240x320 emulation mode by default. This is a backward compatibility thing. You need to add a resource to your EXE to allow it to run with the actual screen size.

Try this, make "hiresaware.rc" with notepad, and paste this into it:
Code: [Select]
HI_RES_AWARE CEUX DISCARDABLE
BEGIN
  0x0001
END

Next, compile it into a .res:

Code: [Select]
arm-wince-windres -ihiresaware.rc -ohiresaware.res

(if you have one of the arm-wince packages that does not come with arm-wince-windres, just use windres instead - that also works)

Now you have "hiresaware.res", now you still need to include it. Open your project, and in your main unit, put:

Code: [Select]
{$r hiresaware.res}

I usually put it right below the "uses" clauses in the "implementation" section.

Now, build the program (compile is not enough when you add/change res files!) et voila. The program is running on whatever resolution the device has.

szponiasty

  • Newbie
  • Posts: 2
Re: Lazarus Win CE HTC (VGA resolution)
« Reply #8 on: November 25, 2009, 06:49:52 pm »
Quote
Try this, make "hiresaware.rc" with notepad, and paste this into it:

I've just came here to ask about the same thing - my first day of using lasarus (but have few years of experience in delphi). Same problem on HTC Diamond on WM 6.5. After applying resource to exe - everything is finally ok (even fixed displaying images that didnt fit on the screen, and their "missing" parts were drawed on, in a mirror reflection on the other side of the window :))

Thx a lot.