Recent

Author Topic: LAMW - ImageView round corner not working  (Read 623 times)

Agmcz

  • New Member
  • *
  • Posts: 46
LAMW - ImageView round corner not working
« on: May 07, 2022, 12:37:26 am »
Hi all

ImageView round corner not working!

  ImageView1.SetRadiusRoundCorner(20);
  ImageView1.SetRoundCorner();   

plz fix.

Agmcz

  • New Member
  • *
  • Posts: 46
Re: LAMW - ImageView round corner not working
« Reply #1 on: May 07, 2022, 02:21:37 am »
Fixed  :D

Add a new proc

ImageView.java
Code: [Select]
public void SetClipToOutline(boolean _value) {
   this.setClipToOutline(_value);
}

Laz_And_Controls.pas
Code: [Select]
procedure jImageView.SetClipToOutline(_value: boolean);
begin
  //in designing component state: set value here...
  if FInitialized then
     jni_proc_z(FjEnv, FjObject, 'SetClipToOutline', _value);
end;

Create xml file
res/drawable/imageshape.xml
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners android:radius="10dp" />
</shape>

Using:
Code: [Select]
  ImageView1.ApplyDrawableXML('imageshape');
  ImageView1.SetClipToOutline(True); 

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: LAMW - ImageView round corner not working
« Reply #2 on: May 07, 2022, 11:11:30 pm »


Quote
Add a new proc...


Done!


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

 

TinyPortal © 2005-2018