You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was setting up text using the TextObjectFilterRender and got most things to work. The issue I am facing is with scaling and positioning.
All texts are stretched to the same width, and it also gets stretched
Changing the position by one causes it to move by more than 1 px.
Code:
val text =TextObjectFilterRender()
text.setText(
it.text,
it.textSize,
Color.WHITE,
Typeface.BOLD
)
text.setPosition(
it.x,
it.y
)
val isPortrait = height > width;
if (isPortrait)
text.setPreviewSize(
height,
width,
)
else
text.setPreviewSize(
width,
height,
)
rtmpCamera.getGlInterface().addFilter(text)
Values:
textWithPosition = {ArrayList@10356} size =30= {
text ="Live Stream"
textSize =300.0
x =2.0
y =2.0
}
1= {
text ="1600"
textSize =300.0
x =2.0
y =8.0
}
2= {
text ="1200"
textSize =300.0
x =2.0
y =16.0
}
width =720
height =1337
The text was updated successfully, but these errors were encountered:
The scale is working as expected because the image adapt exactly to the size selected. I can add a method to obtain the original resolution. This way you can use it as reference to adapt your scale without distortion.
About the position, the scale and position is working in percent, no in px but you can calculate the percent to move a px.
For example. If you are using resolution 640x480 and you want move 1px in width:
1 * 100 / 640 = 0.15625f
Hi Pedro,
I was setting up text using the TextObjectFilterRender and got most things to work. The issue I am facing is with scaling and positioning.
Code:
Values:
The text was updated successfully, but these errors were encountered: