Results 1 to 15 of 15

Thread: [VB6] - 1 thot

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    [VB6] - 1 thot

    can i take 1 dragon(for example) irregular shape from 1 image?
    (sorry i don't know the right terms)
    VB6 2D Sprite control

    To live is difficult, but we do it.

  2. #2
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [VB6] - 1 thot

    You are asking if you can extract the dragon shape (and the dragon picture itself) from an image.

    Right now, I don't know. If I figure it out I will let you know


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  3. #3

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: [VB6] - 1 thot

    Quote Originally Posted by jmsrickland View Post
    You are asking if you can extract the dragon shape (and the dragon picture itself) from an image.

    Right now, I don't know. If I figure it out I will let you know
    not the dragon just the shape
    VB6 2D Sprite control

    To live is difficult, but we do it.

  4. #4
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: [VB6] - 1 thot

    Quote Originally Posted by joaquim View Post
    not the dragon just the shape
    You mean the outline? What will you use it for?
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  5. #5
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [VB6] - 1 thot

    OK, shape only. Same problem however.

    Show the image you want to extract the shape from


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  6. #6
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [VB6] - 1 thot

    Quote Originally Posted by Bonnie West View Post
    You mean the outline? What will you use it for?
    I would think it's for a mask of some kind or a shadow image


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  7. #7
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [VB6] - 1 thot

    OK, something I don't understand. Let's say you are able to extract out the shape of the dragon then where are you going to put it? It's going to have to be another image (picturebox or image control, or as a StdPicture in a variable). But in order to see this shape you will need to put it in a control.

    Is the dragon image the only image in the picture? Are the pixels that surround the dragon all same color?


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  8. #8
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: [VB6] - 1 thot

    As it is possibly do-able but might need a bit of knowledge or 3rd party controls. I use simply use PhotoShop (or similar) and use the magic selection tool! One click and your done.

    Just an idea, if background color (white) is all the same color (white) maybe setting all other pixels that are not background color black let's say.
    Than your dragon will be black and background white.
    Sorry if this is impossible for your case, but I would think something like this is do-able.
    Kind of like doing a transparent background, you know!
    Maybe even some api can do it for you, mask your image.

  9. #9

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: [VB6] - 1 thot

    Quote Originally Posted by Max187Boucher View Post
    As it is possibly do-able but might need a bit of knowledge or 3rd party controls. I use simply use PhotoShop (or similar) and use the magic selection tool! One click and your done.

    Just an idea, if background color (white) is all the same color (white) maybe setting all other pixels that are not background color black let's say.
    Than your dragon will be black and background white.
    Sorry if this is impossible for your case, but I would think something like this is do-able.
    Kind of like doing a transparent background, you know!
    Maybe even some api can do it for you, mask your image.
    maybe i can't express me better(sorry) to both..... i did it before using the bitblt(), but by mistake... i need that for do a Transparency Opacity(instead by pixels).. need speed or i still get flickers. and a need speed for capture a form\container(inclued the controls).
    VB6 2D Sprite control

    To live is difficult, but we do it.

  10. #10
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [VB6] - 1 thot

    @joaquim

    Your 1st post states how to extract the shape of a dragon from an image. Your other posts are referring to the fact that you cannot express or explain it correctly. Is all you want to know is how to extract the shape?


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  11. #11

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: [VB6] - 1 thot

    Quote Originally Posted by jmsrickland View Post
    @joaquim

    Your 1st post states how to extract the shape of a dragon from an image. Your other posts are referring to the fact that you cannot express or explain it correctly. Is all you want to know is how to extract the shape?
    yes, but using bitblt().
    (because i need speed)
    Last edited by joaquim; Mar 17th, 2013 at 05:05 PM.
    VB6 2D Sprite control

    To live is difficult, but we do it.

  12. #12
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [VB6] - 1 thot

    OK, you want to extract a shape (a dragon but I assume there may be other shapes) from an image using BitBlt for speed reasons. How this will be done depends on the image itself. I need to see the image


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  13. #13

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: [VB6] - 1 thot

    Quote Originally Posted by jmsrickland View Post
    OK, you want to extract a shape (a dragon but I assume there may be other shapes) from an image using BitBlt for speed reasons. How this will be done depends on the image itself. I need to see the image
    just the shape. the dragon is just a sample
    thanks for all
    VB6 2D Sprite control

    To live is difficult, but we do it.

  14. #14
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: [VB6] - 1 thot

    Even with BitBlt it will cause flicker! I have done this before, the only way would be using some like DirectX. There is a way to make it with BitBlt without any flickering (I think). You will have to load the images to another picturebox (invisible or offscreen) and replace it with that one, what I mean is that you need to preload the image to another picturebox to remove the flickering which is caused by masking images (when you place a masked image, then the transparent picture on top). If you only paint on a picturebox over and over with BitBlt, it will cause the flickering once in a while!

    I might be wrong on this but I have tried this in the past without success (using BitBtl and one picturebox).
    If anyone has a example without any kind of flicker I would also like to use it on some of my projects!

    Edit:
    Ok I have found an old project, might not be the best. Might need some improvement. I did not fix anything I just zipped it and attached it, now it's up to you to see if BitBlt works .
    Hopefully you find out why in my project it still had the flickering! I know I should not have put Timer Interval = 1 but that way its as fast as it can go.
    Attached Files Attached Files
    Last edited by Max187Boucher; Mar 17th, 2013 at 07:49 PM.

  15. #15

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: [VB6] - 1 thot

    Quote Originally Posted by Max187Boucher View Post
    Even with BitBlt it will cause flicker! I have done this before, the only way would be using some like DirectX. There is a way to make it with BitBlt without any flickering (I think). You will have to load the images to another picturebox (invisible or offscreen) and replace it with that one, what I mean is that you need to preload the image to another picturebox to remove the flickering which is caused by masking images (when you place a masked image, then the transparent picture on top). If you only paint on a picturebox over and over with BitBlt, it will cause the flickering once in a while!

    I might be wrong on this but I have tried this in the past without success (using BitBtl and one picturebox).
    If anyone has a example without any kind of flicker I would also like to use it on some of my projects!

    Edit:
    Ok I have found an old project, might not be the best. Might need some improvement. I did not fix anything I just zipped it and attached it, now it's up to you to see if BitBlt works .
    Hopefully you find out why in my project it still had the flickering! I know I should not have put Timer Interval = 1 but that way its as fast as it can go.
    if you put the land together with that tower and then draw it... goodbye flicker
    the isn't what i need.. but thanks anyway
    VB6 2D Sprite control

    To live is difficult, but we do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width