Shadow&Max Active Member Licensed User Longtime User Feb 26, 2014 #1 Simple rectangles and lines for graphically dividing up elements on screen... As views I guess. Would be nice to be able to draw a rectangle around radio buttons, for example, or a dividing line between two sets of controls... I know I can use a panel, but why do that if a simple box around the controls would be easier and probably less resource consumptive.
Simple rectangles and lines for graphically dividing up elements on screen... As views I guess. Would be nice to be able to draw a rectangle around radio buttons, for example, or a dividing line between two sets of controls... I know I can use a panel, but why do that if a simple box around the controls would be easier and probably less resource consumptive.
Informatix Expert Licensed User Longtime User Mar 3, 2014 #2 You can easily display a box image in an imageview or draw a rectangle on a canvas, so why do you need a specific library? The library would mimic what you do in B4A and would use exactly the same resources.
You can easily display a box image in an imageview or draw a rectangle on a canvas, so why do you need a specific library? The library would mimic what you do in B4A and would use exactly the same resources.
Shadow&Max Active Member Licensed User Longtime User Mar 7, 2014 #3 Yes, I suppose you're right... Thanks I used to use the group boxes in VB ALL of the time... Wish we still had 'em. Isn't' a canvas a pretty consumptive thing?
Yes, I suppose you're right... Thanks I used to use the group boxes in VB ALL of the time... Wish we still had 'em. Isn't' a canvas a pretty consumptive thing?
Informatix Expert Licensed User Longtime User Mar 7, 2014 #4 Shadow&Max said: Isn't' a canvas a pretty consumptive thing? Click to expand... A canvas in itself, no. What consumes memory is the way you draw a box for example. If you draw a rectangle, then all the space inside the box is wasted, even if transparent. Drawing four lines in four canvas consumes less memory.
Shadow&Max said: Isn't' a canvas a pretty consumptive thing? Click to expand... A canvas in itself, no. What consumes memory is the way you draw a box for example. If you draw a rectangle, then all the space inside the box is wasted, even if transparent. Drawing four lines in four canvas consumes less memory.
Erel B4X founder Staff member Licensed User Longtime User Mar 7, 2014 #5 You should make sure to initialize the canvas once. Every time you call Canvas.Initialize a mutable bitmap is created with the size of the view.
You should make sure to initialize the canvas once. Every time you call Canvas.Initialize a mutable bitmap is created with the size of the view.
rbghongade Well-Known Member Licensed User Longtime User Mar 10, 2014 #6 Dear friends, I agree to the suggestion that a box can be drawn in designer view, but a line and a circle could not be. Many times we require to draw lines and circles in the designer view. Addition of the basic drawing objects would make it a complete GUI designer. Warm regards,
Dear friends, I agree to the suggestion that a box can be drawn in designer view, but a line and a circle could not be. Many times we require to draw lines and circles in the designer view. Addition of the basic drawing objects would make it a complete GUI designer. Warm regards,
Informatix Expert Licensed User Longtime User Mar 10, 2014 #7 rbghongade said: I agree to the suggestion that a box can be drawn in designer view Click to expand... How? Nothing can be drawn in the designer.
rbghongade said: I agree to the suggestion that a box can be drawn in designer view Click to expand... How? Nothing can be drawn in the designer.
rbghongade Well-Known Member Licensed User Longtime User Mar 11, 2014 #8 Dear informatix, Please excuse my limited knowledge, but i think a panel may be drawn with transparent color. Correct me if i am wrong, but i too wish that the basic drawing objects be available in the next avatar of our beloved b4a!
Dear informatix, Please excuse my limited knowledge, but i think a panel may be drawn with transparent color. Correct me if i am wrong, but i too wish that the basic drawing objects be available in the next avatar of our beloved b4a!
Informatix Expert Licensed User Longtime User Mar 11, 2014 #9 rbghongade said: Dear informatix, Please excuse my limited knowledge, but i think a panel may be drawn with transparent color. Correct me if i am wrong, but i too wish that the basic drawing objects be available in the next avatar of our beloved b4a! Click to expand... So it's just an english translation problem (it is not my first language and, for me, "draw" means "trace lines or place points"). Technically, you cannot "draw" on a panel because it is only a container for other views. When you set a color via the Color property, you create in fact a ColorDrawable that is placed inside the panel (same thing for the background; it's a BitmapDrawable). A possible evolution of the panel could be to generate automatically a ShapeDrawable via a property, that would be inserted inside the panel. If someone wants to do it...
rbghongade said: Dear informatix, Please excuse my limited knowledge, but i think a panel may be drawn with transparent color. Correct me if i am wrong, but i too wish that the basic drawing objects be available in the next avatar of our beloved b4a! Click to expand... So it's just an english translation problem (it is not my first language and, for me, "draw" means "trace lines or place points"). Technically, you cannot "draw" on a panel because it is only a container for other views. When you set a color via the Color property, you create in fact a ColorDrawable that is placed inside the panel (same thing for the background; it's a BitmapDrawable). A possible evolution of the panel could be to generate automatically a ShapeDrawable via a property, that would be inserted inside the panel. If someone wants to do it...
stevel05 Expert Licensed User Longtime User Mar 11, 2014 #10 ShapeDrawable via a property, that would be inserted inside the panel. If someone wants to do it... Click to expand... The code in the top example here http://www.b4x.com/android/forum/th...ws-and-change-checkbox-graphic.36436/#content will do something similar, although it won't be available in the designer. You can change the drawing code to draw what you want. As it is, it only draws rounded rectangles.
ShapeDrawable via a property, that would be inserted inside the panel. If someone wants to do it... Click to expand... The code in the top example here http://www.b4x.com/android/forum/th...ws-and-change-checkbox-graphic.36436/#content will do something similar, although it won't be available in the designer. You can change the drawing code to draw what you want. As it is, it only draws rounded rectangles.