R raistlin74 Member Licensed User Longtime User Mar 21, 2012 #1 Hi all, I'd like to develop an application that work with images. The behaviour should be this : the screen shows an images with only the borders of the image. when you draw with a freehand movement on the image, it should show on the path that has been designed, the colors of the the second image behind the first (that is the same image but with colors), like a magic pen. How can I do this? Thanks in advance for any help. Fabio
Hi all, I'd like to develop an application that work with images. The behaviour should be this : the screen shows an images with only the borders of the image. when you draw with a freehand movement on the image, it should show on the path that has been designed, the colors of the the second image behind the first (that is the same image but with colors), like a magic pen. How can I do this? Thanks in advance for any help. Fabio
NJDude Expert Licensed User Longtime User Mar 21, 2012 #2 I would say, take a look at THIS it will get you started. Upvote 0
R raistlin74 Member Licensed User Longtime User Mar 21, 2012 #3 do you think I can load 2 identical images, the first without colors, the second with the colors. hide the image with colors and show only the white image. and using the bitmapextended library fills the missing colors with the functions : image1.erasecolor(imageWhite, image2.getPixel(imageColor, x, y)) ? Upvote 0
do you think I can load 2 identical images, the first without colors, the second with the colors. hide the image with colors and show only the white image. and using the bitmapextended library fills the missing colors with the functions : image1.erasecolor(imageWhite, image2.getPixel(imageColor, x, y)) ?
thedesolatesoul Expert Licensed User Longtime User Mar 21, 2012 #4 I think a better way will be to use two panels overlaid on each other. Draw the image in the back panel. Draw a black/white rectangle on the front panel. When the user draws on the front panel color it with colors.transparent In that way the back image will be revealed. Sent from my GT-I9000 using Tapatalk Upvote 0
I think a better way will be to use two panels overlaid on each other. Draw the image in the back panel. Draw a black/white rectangle on the front panel. When the user draws on the front panel color it with colors.transparent In that way the back image will be revealed. Sent from my GT-I9000 using Tapatalk
R raistlin74 Member Licensed User Longtime User Mar 22, 2012 #5 thanks for the reply. I'm trying to implement it, but panel.color sets the color for all the panel. What I'd like to achieve is to color transparent a single point, not all background, so when I draw on the screen, the colored image seems to be drawed on the white one. thanks Fabio Upvote 0
thanks for the reply. I'm trying to implement it, but panel.color sets the color for all the panel. What I'd like to achieve is to color transparent a single point, not all background, so when I draw on the screen, the colored image seems to be drawed on the white one. thanks Fabio
thedesolatesoul Expert Licensed User Longtime User Mar 22, 2012 #6 Yes, I know. You need to use a canvas for this. Basic4android - Drawing (Core) Do something like: Code: Copy Dim c as Canvas c.Initialize(panel) Dim Rect1 As Rect Rect1.Initialize(100dip, 100dip, panel.width-100dip, panel.height-100dip) Canvas1.DrawRect(Rect1, Colors.Gray, True, 5dip) panel.Invalidate And then on touch you can draw a circle: Code: Copy c.DrawCircle(x, y, 20dip, Colors.Transparent, True, 1dip) panel.Invalidate Upvote 0
Yes, I know. You need to use a canvas for this. Basic4android - Drawing (Core) Do something like: Code: Copy Dim c as Canvas c.Initialize(panel) Dim Rect1 As Rect Rect1.Initialize(100dip, 100dip, panel.width-100dip, panel.height-100dip) Canvas1.DrawRect(Rect1, Colors.Gray, True, 5dip) panel.Invalidate And then on touch you can draw a circle: Code: Copy c.DrawCircle(x, y, 20dip, Colors.Transparent, True, 1dip) panel.Invalidate
R raistlin74 Member Licensed User Longtime User Mar 22, 2012 #7 Thanks again, while you were answering me, I found the solution looking at Eerel SignatureCapture example Thanks again. Fabio Upvote 0
Thanks again, while you were answering me, I found the solution looking at Eerel SignatureCapture example Thanks again. Fabio