Recent

Author Topic: Presion de tableta grafica.  (Read 11963 times)

circular

  • Hero Member
  • *****
  • Posts: 4467
    • Personal webpage
Re: Presion de tableta grafica.
« Reply #15 on: September 03, 2016, 08:39:45 pm »
Cool.

I have applied some transform to the alpha value for the brush. Is it working properly now?
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4741
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Presion de tableta grafica.
« Reply #16 on: September 03, 2016, 10:29:00 pm »
Ok, it was working in previous commit, only whit a size of 100 or bigger, using 99 gets opaque. Currently it the latest commit remains the same.

I don't know what does the latest commit, if you think the original is better just drop it.

Edit: when i say size is the size of the brush.
« Last Edit: September 04, 2016, 02:25:08 pm by lainz »

oscar11

  • Newbie
  • Posts: 3
Re: Presion de tableta grafica.
« Reply #17 on: September 04, 2016, 01:04:28 pm »
Muchas gracias...tengo una tableta wacom bamboo y funciona la presion de opacidad en el ejemplo...
Una cuestion antes de ponerme a programar  me gustaria saber si es posible hacer esto con las librerias que trae ....
1.tener una ventana de previsualizacion del canvas,donde pueda determinar el zoom de ampliacion .Ya sea 50% 100%  200 % etc...al igual que azdrawing .Supongo que si,pues tienes algo parecido e  implementado en la " ventana de apilado "capas...aunque  limitado el zoom.
2.Poder rotar el Canvas y dibujar sobre el canvas rotado.
Gracias..


lainz

  • Hero Member
  • *****
  • Posts: 4741
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Presion de tableta grafica.
« Reply #18 on: September 04, 2016, 11:01:16 pm »
Supongo que la ventana de previsualización sería posible, aunque de seguro que ahi yo no podría ayudar mucho.

Creo que la rotación del canvas es algo complicado de hacer, además sería algo lento supongo, ya que la renderización se hace via CPU no por aceleración de video.

@circular, you have an idea of why the brush only works with a brush size of 100 or more with the tablet?

circular

  • Hero Member
  • *****
  • Posts: 4467
    • Personal webpage
Re: Presion de tableta grafica.
« Reply #19 on: September 05, 2016, 11:20:20 am »
Se puedo optimizar un poco y si no hay antialiasing puede ser rápido. Para dibujar sobre el canvas rotado, lo que es posible es de dibujar sobre el canvas antes rotación. Para hacer eso, se puedo dibujar con el rotatorio en la dirección opuesta. Quizás lo mas simple seria determinar la TAffineMatrix para mostrar el canvas rotado y dibujarlo con PutImageAffine con AResampleFilter:=rfBox. Cuando eso funciona, se puedo añadir dibujar sobre el canvas.

@lainz: if you use the previous revision, does it work? Otherwise, you can try and debug step by step by adding a breakpoint in the utoolbrush unit, in the DrawBrushAt function.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4741
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Presion de tableta grafica.
« Reply #20 on: September 05, 2016, 05:38:33 pm »
@circular, works the same. It does not use tablet alpha if size is below 100.

I need to debug that.

Edit: I'm not used with the debugger, but I enclosed with begin--end and see what line was called.

Code: Pascal  [Select][+][-]
  1.   if not SubPixelAccuracy then
  2.   begin
  3.     // called only if width >= 100, alpha that works
  4.     toolDest.PutImage(round(x),round(y),coloredBrushImage,dmDrawWithTransparency,GetBrushAlpha(round(Manager.ToolPressure*255)))
  5.   end
  6.   else
  7.   begin
  8.     // called if width < 100, alpha that doesn't works
  9.     toolDest.PutImageSubpixel(x,y,coloredBrushImage,GetBrushAlpha(round(Manager.ToolPressure*255)));
  10.   end;  

so the PutImageSubpixel one is not working. If I call in both cases PutImage works fine.

I tell you again I can't see the difference between using or not GetBrushAlpha.
« Last Edit: September 05, 2016, 06:18:45 pm by lainz »

circular

  • Hero Member
  • *****
  • Posts: 4467
    • Personal webpage
Re: Presion de tableta grafica.
« Reply #21 on: September 06, 2016, 02:12:14 pm »
Ah ok I guess I found the problem.

TBGRAAffineBitmapTransform.ScanPutPixels does not handle GlobalOpacity property.
« Last Edit: September 06, 2016, 04:11:45 pm by circular »
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4741
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Presion de tableta grafica.
« Reply #22 on: September 06, 2016, 04:11:33 pm »
Great you found it, so It will work with no changes on the brush tool when it get's fixed.

circular

  • Hero Member
  • *****
  • Posts: 4467
    • Personal webpage
Re: Presion de tableta grafica.
« Reply #23 on: September 06, 2016, 04:11:58 pm »
I fixed it on Git.  :)
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4741
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Presion de tableta grafica.
« Reply #24 on: September 10, 2016, 08:07:20 pm »
Is working :)

circular

  • Hero Member
  • *****
  • Posts: 4467
    • Personal webpage
Re: Presion de tableta grafica.
« Reply #25 on: September 10, 2016, 08:53:16 pm »
Wonderful  :)
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4741
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Presion de tableta grafica.
« Reply #26 on: September 10, 2016, 11:20:21 pm »
It works very well, with the layer blending modes I can do everything like in Corel Photo Paint or Photoshop.

 

TinyPortal © 2005-2018