Recent

Author Topic: Filled shapes  (Read 3120 times)

tango13

  • New Member
  • *
  • Posts: 30
Filled shapes
« on: May 11, 2021, 12:27:52 pm »
Hi everybody,

I just came across LAMW and the possibility to develop for Android with Lazarus, which is simply amazing! So first of all, allow me to send a biiiiig thank you to the developers, keep up this great work!

I just started to learn and to know the environment, so I might ask something trivial: is there a way to draw, in jdrawingview for instance, some filled shapes like rectangles, circles etc.?

Thank you very much.

Bart

  • Hero Member
  • *****
  • Posts: 4342
    • Bart en Mariska's Webstek
Re: Filled shapes
« Reply #1 on: May 11, 2021, 02:05:19 pm »
TShape perhaps?
You can simply drop it on afrom and set it's properties.

Bart

jmpessoa

  • Hero Member
  • *****
  • Posts: 1871
Re: Filled shapes
« Reply #2 on: May 11, 2021, 04:14:45 pm »

What about "Demos"?

AppDrawingViewDemo1
AppDrawingViewDemo2
AppDrawingInBitmap
AppDrawingInBitmapAndDensity
ColorPicker
AppSurfaceViewDemo1
AppGridColorPickerDemo1

I don't remember about "filled shapes" ...


Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

tango13

  • New Member
  • *
  • Posts: 30
Re: Filled shapes
« Reply #3 on: May 12, 2021, 09:51:29 am »
I'll take a look and let you know.
Thank you.
Ciao

tango13

  • New Member
  • *
  • Posts: 30
Re: Filled shapes
« Reply #4 on: May 12, 2021, 01:42:47 pm »
I'm having problems compiling demos, I always get a "system unit not found" error.
Am I missing something? (obviously yes...  :) )
Thank you.

rsu333

  • Jr. Member
  • **
  • Posts: 50
Re: Filled shapes
« Reply #5 on: May 12, 2021, 04:33:57 pm »
I am  not insulting previous answers but I like to suggest use one more laz4android 2.0.0 [available in laz4apk  [previous version ],  as beginner I am doing same  to learn demos .

jmpessoa

  • Hero Member
  • *****
  • Posts: 1871
Re: Filled shapes
« Reply #6 on: May 12, 2021, 05:30:05 pm »

Hi. tango13!

How you get your "Lazarus for Android"? 
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

tango13

  • New Member
  • *
  • Posts: 30
Re: Filled shapes
« Reply #7 on: May 12, 2021, 06:48:59 pm »
With LAMW Manager (on Windows 10) which, by the way, is just great!
Thank you.

jmpessoa

  • Hero Member
  • *****
  • Posts: 1871
Re: Filled shapes
« Reply #8 on: May 12, 2021, 06:57:35 pm »

@tango13

Can you create a new LAMW project and put the "*.lpi" file here?
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

tango13

  • New Member
  • *
  • Posts: 30
Re: Filled shapes
« Reply #9 on: May 13, 2021, 09:14:00 am »
Thanks for your suggestion, it worked and now at least I can compile the code.
However, I still get an error while building the apk, the error is "Error: \path\to\file\Controls.java:2675: error: package R does not exist".
Can I try anything else?
Thanks a lot!

jmpessoa

  • Hero Member
  • *****
  • Posts: 1871
Re: Filled shapes
« Reply #10 on: May 13, 2021, 03:37:12 pm »

@Tango13

Can you do some test?

Please, change the "Controls.java" line 2675:
[LAMW folder "......\android_wizard\smartdesigner\java"]

old:
Code: Pascal  [Select][+][-]
  1.   Class<?> res = R.drawable.class;
  2.  

to

Code: Pascal  [Select][+][-]
  1.  Class<?> res = android.R.drawable.class;
  2.  
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

tango13

  • New Member
  • *
  • Posts: 30
Re: Filled shapes
« Reply #11 on: May 13, 2021, 07:04:22 pm »
Ok, it seems that we are moving forward  :)
On the lines  Class<?> res = R.drawable.class; your suggestion made the error disappear.
However, there are more lines with the same error, lines like
Code: Pascal  [Select][+][-]
  1.  dw = drawableToBitmap (this.controls.activity.getResources().getDrawable(R.drawable.ic_launcher));
If I make the same modification I get a "cannot find symbol" error.

Oh, and I forgot to mention that I get errors also in jCommons.java, in lines like
return  R.color.accent;
The error is the same "package R does not exist".
Thank you.
« Last Edit: May 13, 2021, 07:10:43 pm by tango13 »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1871
Re: Filled shapes
« Reply #12 on: May 13, 2021, 11:22:25 pm »
Well, if you got error here:

Code: Pascal  [Select][+][-]
  1. dw = drawableToBitmap (this.controls.activity.getResources().getDrawable(R.drawable.ic_launcher));
  2.  

then your project is  messy!

So, please,  create a NEW project!!!!
« Last Edit: May 14, 2021, 03:26:10 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

 

TinyPortal © 2005-2018