Forum > Other
Custom shape of forms with X11
(1/1)
Fred vS:
Hello.
I try to find a nice way to do custom shapes of forms for X11/XWayland.
X11 gives XDrawRectangle, XFillRectangle and XDrawArc, XFillArc for this.
Example, a from with shape ellipse:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- XDrawarc(appdisp, pmap, shape_gc, 0, 0, width-1 , height-1, 0, 360*64); XFillarc(appdisp, pmap, shape_gc, 0, 0, width-1 , height-1, 0, 360*64);
Now for complex shapes, other developers advice to use many XDrawRectangle+XFillRectangle of different sizes.
And all those rectangles will do the wanted custom form.
Example of a rectangle:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- XDrawRectangle(appdisp, pmap, shape_gc, width div 2, 0, width , height div 3); XFillRectangle(appdisp, pmap, shape_gc, width div 2, 0, width , height div 3);
OK, but using a bitmap monochrome b/w where all the black shapes should be replaced by those rectangles, what would be the steps?
Maybe using BGRABitmap to scan the monochrome bitmap and then create the rectangles?
Any idea is welcome.
Thanks.
Fre;D
Navigation
[0] Message Index