Results 1 to 20 of 20

Thread: [RESOLVED] I want make a project to can read PSD File and show layers in transparent form in vb6

  1. #1

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Resolved [RESOLVED] I want make a project to can read PSD File and show layers in transparent form in vb6

    hi.

    I want make a project to can read PSD File and show layers in transparentform in vb6.any way ?


    for example i have 2 layer in PSD File and their name are Button and Button_Over,so i want read two layers and show in transparent form and when i move my mouse on button

    layer,show Button_over layer on it.

    I found samples to can read psd file and show layers on form but cant show on transparent form?

  2. #2
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: I want make a project to can read PSD File and show layers in transparent form in

    if you export both layer as PNG, you can use Lavolpe Alpha Image control to show them as a button.
    Most of time though, using Lavolpe Alpha Image Control, I prefer to use only 1 layer (PNG) and use the effect of the Lavolpe Alpha Image control. you ca achieve very good result.

  3. #3

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: I want make a project to can read PSD File and show layers in transparent form in

    i want use PSD file format only because matter for me and a simple version of adobe so for example adobe photoshop 8.
    my steps are :
    1- designed a psd file in photoshop with more than 1 layers for example 2 or 3 or 4 or more.... and saved like sample.psd.
    2- in vb6 can read sample.psd and can read layers and then show each layers in one form or can read all layers and show all layers on one form and then i want transparent form becase i like show just layers without form like show on dekstop effect.
    3- i want can hv been event for example when a layer shown then can click on layer on when moure overed show another layer.

    and can u explain this in other forums about alpha control and psd format:
    "Maybe you missed that the control is provide with full source code, so you should add your code to read PSD files among the other formats. Take as example the cFunctionsTGA.cls and do the same with the PSD. " what that means do u hv any example to i can understand this means?!!!
    my language is not english.
    Last edited by Black_Storm; Jan 16th, 2017 at 08:07 AM.

  4. #4
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: I want make a project to can read PSD File and show layers in transparent form in

    Quote Originally Posted by Black_Storm View Post
    i want use PSD file format only because matter for me and a simple version of adobe so for example adobe photoshop 8.
    my steps are :
    1- designed a psd file in photoshop with more than 1 layers for example 2 or 3 or 4 or more.... and saved like sample.psd.
    2- in vb6 can read sample.psd and can read layers and then show each layers in one form or can read all layers and show all layers on one form and then i want transparent form becase i like show just layers without form like show on dekstop effect.
    3- i want cam hv been event for example when a layer shown then can click on layer on when moure overed show another layer.

    and can u explain this in other forums about alpha control and psd format:
    "Maybe you missed that the control is provide with full source code, so you should add your code to read PSD files among the other formats. Take as example the cFunctionsTGA.cls and do the same with the PSD. " what that means do u hv any example to i can understand this means?!!!
    my language is not english.
    Ok, I understand more what you want to achieve. Still, I personnally believe it is not the proper way. Adobe Photoshop 8 has an unique way of saving the document. in futur, if for any reason saving into that mode would not exist anymore (for compatibility reason) then your component would be broken. In other word, you risk creating something that will be obsolete some day. This won't happen with IMAGE format because their standart are there to stay (BMP for example are obsolete but can still be read since 1980 but we can no longuer read PSD version 1)

    That being said, I don't know myself how to read PSD, so I can be of little help. I can show you how to achieve your goal with image format with transparency like PNG (wich is an export format of PSD)

    as for the translation you asked, the guy mean that Lavolpe Alpha Image Control is provided with full source code. Therefore, you "could" modify it to read PSD. (wich I won't recommend because the component is very complex and you risk to break it down)

    what is your native language ? (english is not my primary language eitheir)

  5. #5

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: I want make a project to can read PSD File and show layers in transparent form in

    i know what u say but i should be finish this work and i dont want save psd file like as png or other formats,because i need all layers(unlimited counts) in one file and can move easy with my exe file and other needed files and matter is for me it "show on transparented form".i can read and show now,but my problem is show on transparented form.
    Attached Files Attached Files

  6. #6
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: I want make a project to can read PSD File and show layers in transparent form in

    Quote Originally Posted by Black_Storm View Post
    i know what u say but i should be finish this work and i dont want save psd file like as png or other formats,because i need all layers(unlimited counts) in one file and can move easy with my exe file and other needed files and matter is for me it "show on transparented form".i can read and show now,but my problem is show on transparented form.
    That is the point I don't understand. using "show on transparented form" is really easy with PNG
    I'll look at your code later, I need to leave for now.

  7. #7

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: I want make a project to can read PSD File and show layers in transparent form in

    this picture can show what i want :
    Attached Images Attached Images  
    Last edited by Black_Storm; Jan 16th, 2017 at 08:45 AM.

  8. #8

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: I want make a project to can read PSD File and show layers in transparent form in

    i used SetLayeredWindowAttributes API but result was been this image (not good).
    i checked source code and can find this code :
    Code:
    SetPixelA theHdc, x + FLeft, y + FTop, r, g, b, a
    this is main command for read from layer data and theHdc is same form.hdc .
    i added SetLayeredWindowAttributes API after form load and checked and added after end of show layers and checked but result was been like attached my image,how can make good quality with shadows or ... ?


    Name:  error2.PNG
Views: 1025
Size:  253.1 KB


    can i send source code and maybe u can fix it for me?
    Last edited by Black_Storm; Jan 17th, 2017 at 03:50 PM.

  9. #9

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Arrow Re: I want make a project to can read PSD File and show layers in transparent form in

    i sent source code here,help for fix problem.thanks.

    i want these changes :
    1- can show on dekstop like old image attached in #7. (important)
    2-i want make over action for example can drag and drop layered form or can read 2 layer from psd and can make button and over button event wihtout any window just transparented like work on dekstop.
    Attached Files Attached Files
    Last edited by Black_Storm; Jan 17th, 2017 at 04:03 PM.

  10. #10
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: I want make a project to can read PSD File and show layers in transparent form in

    Quote Originally Posted by Black_Storm View Post
    i sent source code here,help for fix problem.thanks.

    i want these changes :
    1- can show on dekstop like old image attached in #7. (important)
    2-i want make over action for example can drag and drop layered form or can read 2 layer from psd and can make button and over button event wihtout any window just transparented like work on dekstop.
    can you send exported image as PNG ?

  11. #11

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: I want make a project to can read PSD File and show layers in transparent form in

    why i should be send export image as png?!!! i want just work with psd format like attached in #9.
    did u check source code?
    result?
    Last edited by Black_Storm; Jan 18th, 2017 at 06:17 PM.

  12. #12
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: I want make a project to can read PSD File and show layers in transparent form in

    Quote Originally Posted by Black_Storm View Post
    why i should be send export image as png?!!! i want just work with psd format like attached in #9.
    did u check source code?
    result?
    Hi,

    I made a code example... I didn't look at your code yet and I'll try *again* to explain why.
    PS Document are *NOT* image. therefore, there is NO transparency in it. what you see in PSD that is transparency is "the representation of it" it is *merely* the action of GDI+ inside the program that *show* the transparency. The document in itself *DOESN'T* have transparency but the program (photoshop or any program that can read PSD) *translate* the transparency layer and ask GDI+ to show it *AS* transparent.

    That being said, I WILL look at your source as soon as I have time. in the meanwhile, further in this post you'll find an example using PNG wich is NOT a document but an image WICH have transparency.

    Furthermore, let me explain a notion of transparency. There is 2 kind of transparency. There is the "simple" transparent mode wich you can see in GIF where you can for example make background transparent and there is the "alphablending" transparency wich make a "blue" pixel for example that you can see half through.

    in the example you show (what you achieve in Vb6), your "document image" is using the 2 kind, wich is perfectly legal in an image but make thing complicated in Vb6 because of some limitation of this language.

    Vb6 can perfectly use the "simple" transparency to make the form transparent and therefore you'll see only the image BUT if the image contain also Alphablending transparency, you cannot achieve your goal (therefore, the shadow is out of reach)

    This being said, the Alphablending transparency is possible for an entire form in Vb6. (would make your form in a way you can see half through it) but this is not the goal you want to achieve.

    take a look at this image or my example in Vb6:

    Name:  example.png
Views: 876
Size:  18.5 KB

  13. #13

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: I want make a project to can read PSD File and show layers in transparent form in

    i am waiting to ur help yet,just open my attached source code in #9 post and work on it.

  14. #14
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: I want make a project to can read PSD File and show layers in transparent form in

    Quote Originally Posted by Black_Storm View Post
    i am waiting to ur help yet,just open my attached source code in #9 post and work on it.
    Ok, I'll look at it. we need to focuss on this thread though because I hate to pollute Lavolpe forum with matter not directly related to his AIC.

    First, I didn't understood you wanted to show the "control" with the image. I'll first look at your source on the other thread to understand how you made the aPNG work on desktop without showing the control because I can do the exact opposite (show the control with the image but not animated)

    then I'll try to fix the code to suit your need.
    this is an interesting idea, I didn't know it was possible to make aPNG with AlphaTransparency and show it on desktop. I always used PNG with standart transparency to achieve this goal.

    I'll be back soon

  15. #15
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: I want make a project to can read PSD File and show layers in transparent form in

    ok, not sure if that is what you want...
    I review the code... so badly programmed though
    it would take me week to debug it and fix everything...
    anyway, first with the commentary:

    1. Use CONST for the transparency GWStyle color; this will help you avoid using different color in different place of the code.
    2. NEVER.... EVER.... use "END" statement. this is real bad programming. I didn't fix it though.
    End is like "asking windows to CRASH the program, no matter what is currently running or opened"
    you should always use the Query_Unload, and the Unload method and the "unload me" or "unload formName" directive
    3. always CLOSE open file after you processed it. I saw some "close" directive at the EXIT menu.

    from program in post #9, I added a command button on form
    and I added a Layer Menu.
    first, open your PSD, then click the Layer menu, then you'll see the Exit Button is still visible.

    I'm not sure what else you wanted to achived.
    Like I said, to my knowledge, it is NOT possible to use AlphaTransparency for this kind of use. You can only use "regular" transparency
    a similar program I made and showed on post #12 is using regular transparency png.
    http://VbNetMatrix.com/Download/SampleCode2.zip

    *sorry I don't have the attach file function from my side*

  16. #16
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: I want make a project to can read PSD File and show layers in transparent form in

    can you post the little aPNG image you got on the other thread so I can experiment with it ?

  17. #17

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: I want make a project to can read PSD File and show layers in transparent form in

    Quote Originally Posted by VbNetMatrix View Post
    ok, not sure if that is what you want...
    I review the code... so badly programmed though
    it would take me week to debug it and fix everything...
    anyway, first with the commentary:

    1. Use CONST for the transparency GWStyle color; this will help you avoid using different color in different place of the code.
    2. NEVER.... EVER.... use "END" statement. this is real bad programming. I didn't fix it though.
    End is like "asking windows to CRASH the program, no matter what is currently running or opened"
    you should always use the Query_Unload, and the Unload method and the "unload me" or "unload formName" directive
    3. always CLOSE open file after you processed it. I saw some "close" directive at the EXIT menu.

    from program in post #9, I added a command button on form
    and I added a Layer Menu.
    first, open your PSD, then click the Layer menu, then you'll see the Exit Button is still visible.

    I'm not sure what else you wanted to achived.
    Like I said, to my knowledge, it is NOT possible to use AlphaTransparency for this kind of use. You can only use "regular" transparency
    a similar program I made and showed on post #12 is using regular transparency png.
    http://VbNetMatrix.com/Download/SampleCode2.zip

    *sorry I don't have the attach file function from my side*
    week?!!! rly?!!! one day just enough for understand methods and codes,was been not hard work(f8 and step 2 step was been enough,take a easy ).

    when i downloaded this source code from google search i changed at half an a hour or between2 or 3 hours just to merged with alpha transparency or changed to merg with DC but result was been not good .(what ever).

    but

    thanks for ur time but no,your souce code attached sent was not been my means and my needed,i should be wait here for more helps.
    i should be try for make transparent and good quality for each layer readed yet ...
    Last edited by Black_Storm; Jan 29th, 2017 at 04:32 PM.

  18. #18

    Thread Starter
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: I want make a project to can read PSD File and show layers in transparent form in

    Quote Originally Posted by VbNetMatrix View Post
    can you post the little aPNG image you got on the other thread so I can experiment with it ?
    ok i sent attachment with 2 simple apng images in post #585

    important:
    dont forgot i hv 2 problems in other thread
    1-need merg controls with aic(+apng animation images) in same time (post #584).
    2-i sent other question in #584 about play frames with my steps like as descriptions in post #584.
    Last edited by Black_Storm; Jan 29th, 2017 at 04:21 PM.

  19. #19
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: I want make a project to can read PSD File and show layers in transparent form in

    Quote Originally Posted by Black_Storm View Post
    ok i sent attachment with 2 simple apng images in post #585

    important:
    dont forgot i hv 2 problems in other thread
    1-need merg controls with aic(+apng animation images) in same time (post #584).
    2-i sent other question in #584 about play frames with my steps like as descriptions in post #584.
    play fram is easy to fix with aPng... but like I explained, you can't use image with AlphaTransparency, just regular transparency. This is because of "background" limitation of Form. You can make something transparent but not "half transparent" otherwise, you can make the "whole" form half transparent but that won't solve "fix" for your goal.

    the "ball" png you sent use such AlphaTransparency, the other image seem to be regular.
    The image I wanted is the little blue guy running, I wanted to see if he was "regular"

    as for the code in the project... I didn't intended to hurt your feeling. it is just badly programmed it would take me at least few days to fix it to my level of "clarity" but that might be just me, I like to see proper coding with proper indent and OPEN / CLOSE in same sub routine, not OPEN somewhere and CLOSE in the unload event as a "safety" this is what I call bad programming.

  20. #20
    Addicted Member
    Join Date
    May 2011
    Posts
    230

    Re: I want make a project to can read PSD File and show layers in transparent form in

    I still don't understand your reference to post #584
    what do you need, I don't understand ?

    you want control appear and AIC appear ? that's what I did in the code I sent back.
    ( I just added a command button on the form in fact, you had already the rest of the code)
    and the command button is showing. So if I missed something, tell me because they way I understand it, it work.

Tags for this Thread

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