Page 1 of 1

Posted: Tue Dec 03, 2002 6:41 pm
by BackupUser
Restored from previous forum. Originally posted by ricardo.

Hi,

This SkinWin lib are really great!!

I have 2 wishes:

1.- SkinWin(hWnd, hBitmap, x, y)

Where we can determine the coordinates of the pixel that will be taken as the transparency color. Sometimes our images could not have the desired transparency color at 0,0.

2.- SkinWin(hWnd,x, y)


This one could be GREAT.
Imagine that i want to make transparent some imagen that is not a bmp or gif or jpg... maybe some flash or other format.
Its possible to point the library to the window where the imagen is displayed and that the lib. uses it to make the skin?

Other way could be to take some screenshot of the window, save it to the HD and then call the lib as usuall... its possible to do it? how can i take a screenshot of certain window in runtime and save it to the HD?

---------------------------------------------------------------------

What im doing is create skinwins for a window that contains a webgadget and the web gadget contains a flash movie with and interface.
At the moment im using the same bitmap that i used to create the flashmovie as the bitmap to create transparency, but not always the 0,0 pixel is the one that i want to use fr transparency... but some other of my flashmovies dont use a bitmap at all.
Im trying to create the skinwin at runtime.

I hope i explain correctly my point.

Thanks again to Danilo for his great Library.






Best Regards

Ricardo

Dont cry for me Argentina...

Posted: Thu Dec 05, 2002 2:42 am
by BackupUser
Restored from previous forum. Originally posted by PB.

> Thanks again to Danilo for his great Library.

Does Danilo have a web site? I don't know where to get this library.

Posted: Thu Dec 05, 2002 2:49 am
by BackupUser
Restored from previous forum. Originally posted by Paul.

Where can you normally find all the ASM User Libraries??
The Resources Site of course :)


----------
Visit the PB Resources Site at http://www.reelmediaproductions.com/pb

Posted: Thu Dec 05, 2002 3:05 am
by BackupUser
Restored from previous forum. Originally posted by PB.

> Where can you normally find all the ASM User Libraries??
> The Resources Site of course :)
> http://www.reelmediaproductions.com/pb

Oops, of course! :)

Posted: Thu Dec 05, 2002 6:36 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

@ricardo:
> I have 2 wishes:
>
> 1.- SkinWin(hWnd, hBitmap, x, y)
>
> Where we can determine the coordinates of the pixel that will be
> taken as the transparency color. Sometimes our images could not
> have the desired transparency color at 0,0.

I know about this problem, but i wanted to make it
like SkinWin(hWnd, hBmp, color).
If you need to get the color value at runtime, you
can use the PB-command Point(x,y) on the image.

> This one could be GREAT.
> Imagine that i want To make transparent some imagen that
> is not a bmp Or gif Or jpg... maybe some flash Or other format.

Other formats are not supported and i need an image
to scan for the transparent area.

> Other way could be To take some screenshot of the window,
> save it To the HD And then call the lib as usuall...
> its possible To do it?

Sure, thats possible - but saving to HD isnt needed.
You could make a screenshot and use that image-handle
directly with SkinWin.

> how can i take a screenshot of certain window in runtime
> And save it To the HD?

Here 2 small procedures to make
a screenshot of a desktop area and
take a shot from a specific window.

Code: Select all

Procedure MakeWinScreenshot(ImageNr,hWnd,Width,Height)
   hImage = CreateImage(ImageNr,Width,Height)
   hDC = StartDrawing(ImageOutput())
      BitBlt_(hDC,0,0,Width,Height,GetDC_(hWnd),0,0,#SRCCOPY)
   StopDrawing()
   ProcedureReturn hImage
EndProcedure

Procedure MakeDesktopScreenshot(ImageNr,x,y,Width,Height)
   hImage = CreateImage(ImageNr,Width,Height)
   hDC = StartDrawing(ImageOutput())
      BitBlt_(hDC,0,0,Width,Height,GetDC_(GetDesktopWindow_()),x,y,#SRCCOPY)
   StopDrawing()
   ProcedureReturn hImage
EndProcedure



OpenWindow(1,0,0,615,320,#PB_Window_SystemMenu|#PB_Window_Invisible|#PB_Window_ScreenCentered,"")
  CreateGadgetList(WindowID())

hShotWindow = FindWindow_(0,"PureBasic")
If hShotWindow
   hWinBmp  = MakeWinScreenshot(1,hShotWindow,300,300)
   hDeskBmp = MakeDesktopScreenshot(2,500,300,300,300)
   ImageGadget(1,005,10,300,300,hWinBmp)
   ImageGadget(2,310,10,300,300,hDeskBmp)
Else
   hDeskBmp = MakeDesktopScreenshot(2,500,300,600,300)
   ImageGadget(1,0,0,600,300,hDeskBmp)
EndIf

HideWindow(1,0)

Repeat
  Select WaitWindowEvent()
    Case #PB_EventCloseWindow : End
  EndSelect
ForEver
So you can use the handle of the created
screenshot directly - saving To HD is too slow.

> Im trying To create the skinwin at runtime.

Thats not very good, because its slow.

Because i want to allow transparency areas
everywhere in the image, i have to scan all
pixels of the image step by step - and thats slow.
The bigger the image the slower it is.

I wrote a new version of SkinWin which takes
not an image, but a SkinFile (my own format).
So you use the SkinMaker before you write the
program to generate the SkinFile.
The result is _much_ faster (i would say "instant").

You need the runtime skinning (which will of course
still be included in the lib), but so its always
very slow.

One way could be to make SkinFiles for the whole
Flash movie before you program the app - but dont
ask me how to get all the separate images out of
the Flash movie...

cya,
...Danilo

(registered PureBasic user)

Posted: Tue Dec 17, 2002 6:25 pm
by BackupUser
Restored from previous forum. Originally posted by ricardo.

Danilo,

Thanks for your reply.
Do i understand well that there will be soon a n ew version of your excellent lib???

Thanks and continue being such good coder!


Best Regards

Ricardo

Dont cry for me Argentina...