It is currently Mon Dec 11, 2017 5:08 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Bucket Fill advanced & Sprite support for Images and Can
PostPosted: Mon Dec 12, 2016 7:35 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 683
Now, all works fine.

Other apps :
QUICK-AES-256 and the NV Simulator you can found here:
http://www.nachtoptik.de

Very interesting is this little AES coder, he can make many encryption things absolutely simple
This coder can handle string encrypting without string termination problems !
http://www.purebasic.fr/english/viewtopic.php?f=27&t=66894

Cool ist also this very little and fast Breakout
http://www.purebasic.fr/english/viewtopic.php?f=12&t=58054&hilit=breakout

And a other very nice little code for christmas
http://www.purebasic.fr/english/viewtopic.php?f=12&t=57663

Moving lines, a tricky animation tool for many things
http://www.purebasic.fr/english/viewtopic.php?f=12&t=66895

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Last edited by walbus on Tue Apr 25, 2017 8:16 am, edited 7 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Sprite support for Images and Can
PostPosted: Tue Dec 27, 2016 12:34 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 683
Codes updated d26 m12 y2016

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Sprite support for Images and Can
PostPosted: Tue Dec 27, 2016 1:33 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 04, 2015 7:10 am
Posts: 1673
very cool work walbus!
btw this pic you posted earlier in the thread reminds me of Photoshop's Content-Aware Fill (which blew my mind when Adobe first released pics of it a few years agol!) :)
is it a similar or related algorithm or something completely different?
btw i just found this link at the Content-Aware Fill page that shows the technique Photoshop is using! fascinating! :)
http://www.wisdom.weizmann.ac.il/~visio ... etion.html
Image

_________________
Thankyou to all the coders who generously helped & encouraged me in the nearly 2yrs when i was welcome here,
it was a tremendous privilege. I learned a lot. I wish you and your families all the best and success for the future.


Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Sprite support for Images and Can
PostPosted: Tue Dec 27, 2016 7:31 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 683
Hi Keya,
many thanks for your friendly words.

I can not say how Photoshop® make the effects.
The routine i use for the demo above is very good for all lively pictures.

Also primary for water and clouds.

Best regards Werner

Image

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Last edited by walbus on Mon Jan 02, 2017 1:37 pm, edited 5 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Sprite support for Images and Can
PostPosted: Wed Dec 28, 2016 12:39 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 683
Codes updated d28 m12 y2016

Added : Function AlphaChannelSprite :wink:
This is a new cool feature for using any pictures with alpha channel (PNG, TIFF) as sprite.
The function realize a high quality output for all pictures with a included alpha channel.

Features :
Can use defined parties from a sprite
Can create pattern with any sizes from sprites
Multiple sprite output

For using this function you must use pictures with alpha channel, or you see nothing !
Code:
  AlphaChannelSprite_BF(image_ID, texture_ID,        ; Function for using any images with alpha channel as sprites
                                texture_x,           ; Output x pos
                                texture_y,           ; Output y pos
                                texture_width,       ; Is this parameter larger as the sprite, you become a multiple sprite output
                                texture_height,      ; Is this parameter larger as the sprite, you become a multiple sprite output
                                texture_clip_x,      ; Output start pos inside the sprite x - clipping
                                texture_clip_y,      ; Output start pos inside the sprite y - clipping
                                texture_clip_width   ; Output end pos inside the sprite - clipping
                                texture_clip_height) ; Output end pos inside the sprite - clipping
What is a multiple sprite output ?
You use a picture with a width from 100 and a height from 100
Set you now as sample texture_x to 100 and texture_width to 500, you become 5 sprites in a row !

Set you also texture_y to 100 and texture_height to 500,
you become the same vertical, also all over 25 sprites rectangular arrangemented as output :o

texture_width and texture_height are presetted to the width and length from your destination image or canvas
Set you this both parameter not,
you become a multiple sprite output up to your picture or canvas width or height (Full length, full height)

Image

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Last edited by walbus on Sat Jan 14, 2017 10:17 am, edited 3 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Flood Fill & Sprite & Texture sup
PostPosted: Thu Dec 29, 2016 12:11 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 683
codes updated d29 m12 y2016

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Last edited by walbus on Mon Jan 02, 2017 4:46 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Flood Fill & Sprite & Texture sup
PostPosted: Thu Dec 29, 2016 11:04 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 683
New function for BucketFill advanced for images added

Function CreateSprite_from_AlphaImage_BF :wink:

Features :
This new feature converts all loadable images with alpha channel to standard sprites with a included mask.
Color distance function for removing shadows or other from the mask inclusive

So you can create simple high quality sprites with invisible color from many pictures with alpha channel (PNG, TIFF).

How?
Standard sprites are very flexible in BF, you can add alpha, color distance, can use it as texture,
can manipulate the invisible color, can replace the invisible color with textures, can use FloodFill, BucketFill,
creating masks and manipulate the output with the BF Arrays, a lot...

For using this function you must use pictures with alpha channel !

Image
Looking, the both right, from PNG pictures with alpha channel converted sprites, are JPG pictures
Normaly, you can not use JPG pictures with included mask as sprite
The mask color is on JPG ever not clean and you become ever visible artefacts
But, with BF advanced, you can use JPG encoded sprites !
With the color distance function you can clean automatically the mask :o

Code:
; ============== Use BucketFill advanced for images ===============

UseJPEGImageDecoder() : UsePNGImageDecoder() : UseJPEGImageEncoder()

; - Call BF function #1 - Convert a image with alpha channel to a sprite with included mask

path$=OpenFileRequester("Select a picture", "", "", 0)
If path$="" : End : EndIf

image_ID=LoadImage(#PB_Any, path$)
background_color=$FF00FF ; Set a background color (Mask color)
percent_color_distance=20 ; You can set a color distance for the background color in percent
result=CreateSprite_from_AlphaImage_BF(image_ID, background_color, percent_color_distance)
SaveImage(result, GetPathPart(path$)+"BF_advanced_sprite.jpg", #PB_ImagePlugin_JPEG, 10, 24)
ErrorCheck_BF(result)

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Last edited by walbus on Thu Jul 13, 2017 9:10 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Flood Fill & Sprite & Texture sup
PostPosted: Fri Dec 30, 2016 4:07 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 683
Angry, sprites with invisible color are mostly GIF´s with few colors, or BMP´s and large...

With BF advanced you can solve this problems

Simple you can use high compressed JPG images as sprites :o

Image
You can get the lion picture above directly for testing the sample code
You must not change this demo picture with the both lions above for using with the demo code ! :wink:

Demo code :
Code:
XIncludeFile("./BucketFill_advanced.pbi")

; - Demo - Load a image with mask as sprite
;   This works not with sprites or pictures without mask
;   For some other pictures it is available you must change the color distance for the sprite mask

UsePNGImageDecoder()
UseJPEGImageDecoder()
CompilerIf #PB_Compiler_Version=>560
  UseGIFImageDecoder()
CompilerEndIf

EnableExplicit

Define window_ID, win_event, image_ID, texture_ID, background_ID, result
Define image_x, image_y, image_width, image_height, point
Define path$, path_1$

#SoilWall="./BucketFill_Image_Set/soil_wall.jpg"

; Presets
image_width=600 : image_height=475

path_1$=OpenFileRequester("Select a sprite", "", "", 0)
If path_1$="" : End : EndIf

image_ID=LoadImage(#PB_Any, #SoilWall)

background_ID=CreateImage(#PB_Any, image_width, image_height)

window_ID=OpenWindow(#PB_Any, 0, 0,
                     image_width, image_height, "Bucket Fill advanced - For Images",
                     #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

; - Call function #1 -
path$=#SoilWall
texture_ID=LoadImage(#PB_Any, path$)
result=BF(-2, background_ID, texture_ID)
ErrorCheck_BF(result)

StartDrawing(ImageOutput(background_ID))
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(180, 25, "A VERY COOL FUNCTION !", -1)
DrawText(380, 45, "BUCKET FILL ADVANCED", -1)
DrawText(380, 65, "www.quick-aes-256.de", -1)
DrawText(380, 85, "www.nachtoptik.de", -1)
DrawText(380, 105, "Sprites simple for Images", -1)
StopDrawing()

SetColorDistanceSpriteMask_BF(30) ; percent

; - Call function #2 -
texture_ID=LoadImage(#PB_Any, path_1$) ; Sprite mode
ResizeImage(texture_ID, image_width, image_height)

result=BF(1, background_ID, texture_ID,
          0,                                   
          0,                                 
          0,                           
          0,                             
          600,                           
          475)
ErrorCheck_BF(result)

Define canvas_ID=CanvasGadget(#PB_Any, 0, 0, ImageWidth(background_ID), ImageHeight(background_ID))

StartDrawing(CanvasOutput(canvas_ID)) ; Get the result
DrawImage(ImageID(background_ID), 0, 0)
StopDrawing()

Repeat
  win_event=WaitWindowEvent()
  If win_event=#PB_Event_CloseWindow
    FreeTextures_BF() ; Free grabed textures
    Break
  EndIf
ForEver

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Last edited by walbus on Thu Jul 13, 2017 9:14 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Flood Fill & Sprite & Texture sup
PostPosted: Sat Dec 31, 2016 8:27 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 683
Codes updated d31 m12 y2016

A very cool and nice new feature added :wink:

BF advanced can now simplest directly output fine seamless photos on pictures and canvas :o
This works also with textures :wink:

What you must do :
Add this codes simple to the demo part from the modules
Load a photo
Have fun !
Code:

  ; mode 0      = normal photo output
  ; mode 1 to 3 = seamless, three step widths available - mode 4 to 256 = alpha blending

  EmbeddingPhoto_BF(3, image_ID, photo_ID, ; For images and canvas
                                      100, ; Output pos x
                                      200, ; Output pos y
                                      180, ; Photo width - What ever you want - Automatic resizing
                                      150) ; Photo height - What ever you want

Image

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Last edited by walbus on Thu Jul 13, 2017 9:16 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Flood Fill & Sprite & Texture sup
PostPosted: Sat Dec 31, 2016 9:39 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 3425
Location: Utah, USA
walbus wrote:
Codes updated d31 m12 y2016

Thanks for the continuing updates and improvements.

You made a possible goof, you posted the same code for 'BF Canvas' as you did for 'BF Image' in the first messages.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Flood Fill & Sprite & Texture sup
PostPosted: Sat Dec 31, 2016 11:16 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 683
Hi Demivec,
thanks for the hint and the friendly words

Codes now again updated

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Flood Fill & Sprite & Texture sup
PostPosted: Tue Jan 10, 2017 8:17 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 683
Codes updated d09 m01 y2017

Function SpriteSimple_BF added

What can do this new function ?

The function can simplest output sprites on images and canvas
Can output masked sprites, textures, images, images with alpha channel and photos, as sprites
Alpha blending and output resizing is included in the function !

And you can add BF color distance for sprites, for using BF JPG compressed masked sprites
For this feature set before you call the function SetColorDistanceSpriteMask_BF(percent)
Try firstly with about 30 percent
After calling the function deactivate this again with SetColorDistanceSpriteMask_BF(0)

Hint:
BF advanced create shapes, a other name is brushes,
but we can also simple say sprites, for better understanding
Correct is : Sprites are ever hardware created, shapes software created
Looking therefore as sample in the Wikipedia
The Amiga has Sprites, the Atari ST not and we must create shapes
So, BF advanced is a old school programming tool
But it can make many very cool things, simple for using all over :wink:

Code:
  Declare SpriteSimple_BF(mode, image_ID, texture_ID, ; Function for simple using any images as sprites
                          texture_x,                  ; Output pos x
                          texture_y,                  ; Output pos y
                          output_width=0,             ; You can here resize the output x  - With resizing it is slower
                          output_height=0,            ; You can here resize the output y
                          alpha=1)                    ; Set alpha blending from 1 to 256 - BF set 1=full visible - 256=invisible
                                                      ;  You want higher speed output, resize before using this function
                                                      ;  You want high speed output, use the BF function directly for sprite output
                                                      ;  For using JPG based masked sprites, pre use SetColorDistanceSpriteMask_BF(percent)

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Last edited by walbus on Wed Jan 11, 2017 9:09 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Flood Fill & Sprite & Texture sup
PostPosted: Tue Jan 10, 2017 5:16 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 683
Hint :
Deflickering and animation demo for output multiple moved sprites and graphic directly on canvas

With directly output multiple moved sprites or animated graphics on canvas you can become flickering
This is a vsync problem, not a BF advanced problem !
But you can fix this simple :idea:

What you can do ?
Write in a invisible buffer, then display the buffer
This demo code here works similar the PB function FlipBuffers, but you need not a screen mode :wink:

Code:
XIncludeFile("./BucketFill_advanced.pbi")

; - Demo - Deflickering and animation demo for output multiple moved sprites and graphic directly on canvas - RAW

; This demo demonstrate rudimentary BF function using

;CompilerIf #PB_Compiler_Debugger : MessageRequester("Debugger", "Please deactivate firstly the debugger !") : End : CompilerEndIf

UsePNGImageDecoder()
UseJPEGImageDecoder()
CompilerIf #PB_Compiler_Version=>560
  UseGIFImageDecoder()
CompilerEndIf

EnableExplicit

Define window_0, win_event, canvas_ID, window_ID, texture_ID, texture_1_ID, texture_2_ID, temporary_image_ID, result
Define canvas_x, canvas_y, canvas_width, canvas_height, point, arc
Define path$

#GeeBee="./BucketFill_Image_Set/Geebee2.bmp"
#SoilWall="./BucketFill_Image_Set/soil_wall.jpg"
#Testtexture="./BucketFill_Image_Set/testtexture_large.png"
#Penguin="./BucketFill_Image_Set/Penguin.png"

; Presets
canvas_x=50
canvas_y=50
canvas_width=600
canvas_height=400

window_ID=OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, canvas_width+100, canvas_height+100, "Bucket Fill Advanced - For Canvas",
                     #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_Invisible)

canvas_ID=CanvasGadget(#PB_Any, canvas_x, canvas_y, canvas_width, canvas_height)

; - Call function #1 -
path$=#SoilWall
texture_ID=LoadImage(#PB_Any, path$)
result=BF(-2, canvas_ID, texture_ID) ; Make a background texture
ErrorCheck_BF(result)

CompilerIf #PB_Compiler_OS=#PB_OS_Linux
  Define font_1=LoadFont(1, "Arial", 11)
CompilerEndIf

StartDrawing(CanvasOutput(canvas_ID))
CompilerIf #PB_Compiler_OS=#PB_OS_Linux
  DrawingFont(font_1)
CompilerEndIf
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(20, 5, "A VERY COOL FUNCTION !", $FF00)
DrawText(20, 25, "BUCKET FILL ADVANCED", $FF00)
DrawText(20, 45, "www.quick-aes-256.de", $FF00)
DrawText(20, 65, "www.nachtoptik.de", $FF00)
DrawText(220, 5, "Sprites simple for Canvas", $FFFF)
DrawText(220, 25, "Also FloodFill with texture support", -2)
StopDrawing()

; - Sprite animation #1 -
Define x, y, x1, y1, x2, y2, drawing_buffer_len
Define *drawing_buffer_canvas, *drawing_buffer_image, *drawing_buffer_grabed_canvas

path$=#Geebee ; Get a sprite
texture_ID=LoadImage(#PB_Any, path$)

path$=#Testtexture ; Get a sprite
texture_1_ID=LoadImage(#PB_Any, path$)

path$=#Penguin; Get a sprite
texture_2_ID=LoadImage(#PB_Any, path$)
ResizeImage(texture_2_ID, 100, 100)

ResizeImage(texture_ID, 90, 80) ; Resize the sprite

temporary_image_ID=CreateImage(#PB_Any, GadgetWidth(canvas_ID), GadgetHeight(canvas_ID)) ; Create a temporary image for the BF image output

drawing_buffer_len=DrawingBuffer_length_canvas_BF(canvas_ID) ; Get the drawing buffer length
ErrorCheck_BF(drawing_buffer_len)

*drawing_buffer_grabed_canvas=GrabCanvas_BF(canvas_ID) ; Grab the canvas
ErrorCheck_BF(*drawing_buffer_grabed_canvas)

HideWindow(window_ID, 0) ; Show the window, now

Repeat
 
  win_event=WaitWindowEvent(1)
  If win_event=#PB_Event_CloseWindow
    FreeMemory(*drawing_buffer_grabed_canvas) ; Free grabed canvas
    FreeTextures_BF()                         ; Free grabed textures
    FreeImage(temporary_image_ID)             ; Free temporary image
    Break
  EndIf
 
  If Delay_BF(0, 10) ; Timer 0, Time 10 ms - 100 timer available 0 - 99 - you can change
   
    *drawing_buffer_image=DrawingBuffer_image_BF(temporary_image_ID) ; Get the drawing buffer adress from the temporary image
    ErrorCheck_BF(*drawing_buffer_image)                             ; Error check
    *drawing_buffer_canvas=DrawingBuffer_canvas_BF(canvas_ID)        ; Get the drawing buffer adress from the canvas gadget
    ErrorCheck_BF(*drawing_buffer_canvas)                            ; Error check
                                                                     ; This functions here working similar the PB FlipBuffers function
                                                                     ; All things you move on the canvas are now "Ghosts", not a integral part from the based canvas contents
                                                                     ; For including all "Ghosts" in the canvas base buffer do this :
                                                                     ; CopyMemory(*drawing_buffer_canvas, *drawing_buffer_grabed_canvas, MemorySize(*drawing_buffer_grabed_canvas))
                                                                     ; Activate the line above and look what then happens !
                                                                     ; This works so also with BF for images, only when you want it is the "Ghosts" in the image content taken over
    CopyMemory(*drawing_buffer_grabed_canvas, *drawing_buffer_image, MemorySize(*drawing_buffer_grabed_canvas)) ; Refresh canvas
   
    x+1 : y-1
    If x>GadgetWidth(canvas_ID)+100
      x=-(ImageWidth(texture_ID)+100)
    EndIf
    If y<-(ImageHeight(texture_ID)+20)
      y=GadgetHeight(canvas_ID)+20
    EndIf
   
    x1+2 : y1-1
    If x1>GadgetWidth(canvas_ID)+100
      x1=-(ImageWidth(texture_ID)+100)
    EndIf
    If y1<-(ImageHeight(texture_ID)+20)
      y1=GadgetHeight(canvas_ID)+20
    EndIf
   
    x2+1 : y2-2
    If x2>GadgetWidth(canvas_ID)+100
      x2=-(ImageWidth(texture_ID)+100)
    EndIf
    If y2<-(ImageHeight(texture_ID)+20)
      y2=GadgetHeight(canvas_ID)+20
    EndIf
   
    arc+1
    If arc>360 : arc=-arc : EndIf
   
    SetColorDistanceSpriteMask_BF(25) ; Remove artifacts from the sprite mask
   
    ; - Call function - output sprite #1 -
    result=BF(1, temporary_image_ID, texture_ID, ; Sprite mode
              0,                                   
              0,                                 
              x,                           
              y,                             
              ImageWidth(texture_ID),                           
              ImageHeight(texture_ID))
    ErrorCheck_BF(result)
   
    ; Graphic output #1
    If StartVectorDrawing(ImageVectorOutput(temporary_image_ID))
      VectorSourceColor($FFFF0001)
      MovePathCursor (250 , 150)
      AddPathCircle (250 , 150 , 80, 0, arc , #PB_Path_Connected)
      FillPath()
      StopVectorDrawing()
    EndIf
    StopDrawing()
   
    ; - Call function - output sprite #2 -
    result=BF(80, temporary_image_ID, texture_ID, ; Sprite mode
              0,                                   
              0,                                 
              x1-100,                           
              y1-20,                             
              ImageWidth(texture_ID),                           
              ImageHeight(texture_ID))
    ErrorCheck_BF(result)
   
    ; Call function - output sprite #3 -
    result=BF(40, temporary_image_ID, texture_ID, ; Sprite mode
              0,                                   
              0,                                 
              x2+100,                           
              y2+20,                             
              ImageWidth(texture_ID),                           
              ImageHeight(texture_ID))
    ErrorCheck_BF(result)
   
    ; Call function - output sprite #4 -
    result=BF(40, temporary_image_ID, texture_ID, ; Sprite mode
              0,                                   
              0,                                 
              x2+100,                           
              y2+20,                             
              ImageWidth(texture_ID),                           
              ImageHeight(texture_ID))
    ErrorCheck_BF(result)
   
    ; Call function - alphachannel sprite output #1 -
    result=AlphaChannelSprite_BF(temporary_image_ID, texture_2_ID, ; Sprite mode
                                 0,                                   
                                 200,
                                 ImageWidth(texture_2_ID)*6,
                                 ImageHeight(texture_2_ID))                                 
    ErrorCheck_BF(result)
   
    ; Call function - output sprite #5 -
    result=SpriteSimple_BF(1, temporary_image_ID, texture_ID, ; Sprite simple
                           0,
                           0,
                           x,                           
                           100,                             
                           ImageWidth(texture_ID)/2,                           
                           ImageHeight(texture_ID)/2)
    ErrorCheck_BF(result)
   
    ; Call function - output sprite #6 -
    result=SpriteSimple_BF(1, temporary_image_ID, texture_ID, ; Sprite simple
                           0,
                           0,
                           250,                           
                           y,                             
                           ImageWidth(texture_ID)*1.3,                           
                           ImageHeight(texture_ID)*1.3)
    ErrorCheck_BF(result)
   
    ; Graphic output #2
    If StartVectorDrawing(ImageVectorOutput(temporary_image_ID))
      VectorSourceColor($AAFFFF01)
      MovePathCursor (400 , 200)
      AddPathCircle (400 , 200 , 100, 0, arc , #PB_Path_Connected)
      FillPath()
      StopVectorDrawing()
    EndIf
    StopDrawing()
   
    SetColorDistanceSpriteMask_BF(5) ; Remove artifacts from the sprite mask
   
    ; - Call function - output sprite #7 -
    result=BF(1, temporary_image_ID, texture_1_ID, ; Sprite mode
              5,                                   
              5,                                 
              235,                           
              60,                             
              ImageWidth(texture_1_ID),                           
              ImageHeight(texture_1_ID))
    ErrorCheck_BF(result)
   
    ; Get the result
    StartDrawing(CanvasOutput(canvas_ID))
    DrawImage(ImageID(temporary_image_ID), 0, 0)
    StopDrawing()
   
  EndIf
 
ForEver

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Last edited by walbus on Thu Jul 13, 2017 9:05 am, edited 3 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Flood Fill & Sprite & Texture sup
PostPosted: Wed Jan 11, 2017 5:20 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 683
Codes updated d11 m01 y2017

Error detection enhanced
Demo part BF for images enhanced
Better description for FloodFill parameters added to declare part
Little code optimizations
Demo code above for flicker free canvas enhanced and graphic animation added

Hints:
You can set as background for FloodFill and BucketFill a defined color
You fill now with a texture and use alpha blending, so you can simple recoloring textures fine
Looking, both fill functions can use for fill : colors, pictures, textures and photos

_________________
http://www.nachtoptik.de - The home of Bucketfill_advanced (BF) and QUICK_AES_256


Last edited by walbus on Thu Jan 12, 2017 6:33 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Bucket Fill advanced & Flood Fill & Sprite & Texture sup
PostPosted: Wed Jan 11, 2017 11:12 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 6:14 pm
Posts: 1391
Location: Germany (Saxony, Deutscheinsiedel)
Even if I don't have a need for now, I took a quick look and it looks like a very powerful GFX package.
Good is the providing of a complete source code package, which makes it a lot easier (even for a small test) than collecting and updating all codes from the forum thread.

So thanks a lot and keep up the good work! :D

_________________
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye