NO

Author Topic: How to show PNG Images with no window?????  (Read 9198 times)

ml1969

  • Guest
How to show PNG Images with no window?????
« on: July 08, 2009, 07:11:43 PM »
Hello,

I have learnd alot... but there ist still a question / problem....

I want to show an image-file, perhaps a png file with transparency.

I am able to show a bitmapfile, which is include in a window
Code: [Select]
hbit = SHLoadDIBitmap(hStr);

HWND hWnd;


hWnd = CreateWindow(L"imgClass", L"Dialog",  WS_VISIBLE | SS_BITMAP,  0,  0,  50, 50,  NULL, NULL, hInstance, NULL);

HWND imgCtrl = CreateWindow( _T("STATIC"), NULL, SS_CENTERIMAGE | SS_BITMAP | WS_CHILD | WS_VISIBLE, 0, 0 , 50, 50, hWnd, NULL, NULL, NULL);

SendMessage(imgCtrl,STM_SETIMAGE, (WPARAM)IMAGE_BITMAP,(LPARAM)hbit);
.....

So is it possible to show a png-file on the screen with no window(form)? Cause the background of the window is grey and not transparent?

Michael


Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: How to show PNG Images with no window?????
« Reply #1 on: July 08, 2009, 07:14:27 PM »
JohnF has an example of using GDI+ to load and display images at his site.
---
Stefan

Proud member of the UltraDefrag Development Team

ml1969

  • Guest
Re: How to show PNG Images with no window?????
« Reply #2 on: July 08, 2009, 07:43:51 PM »
Hello,

you mean that http://www.johnfindlay.plus.com/pellesc/GdiPlus/GdiPlus.html

Will this work on an PNA?  WinCe 4 ?

Ok I look there thanks

Romashka

  • Guest
Re: How to show PNG Images with no window?????
« Reply #3 on: July 10, 2009, 06:01:39 PM »
Another possibility is to make a shaped window (if you don't need it to be semitransparent).
See the following URL for an algorithm for making a region from a bitmap:
http://www.vbaccelerator.com/codelib/winstyle/bmpwinsh.htm

You can also use layered windows but I am not sure if they are supported on WinCE (and they are not supported on Windows 9x/NT too).

Kaljj

  • Guest
Re: How to show PNG Images with no window?????
« Reply #4 on: September 21, 2009, 12:41:18 PM »
Hello Michael,

I thing it not a great problem, if you only want to show the picture.
At first load the sample for a fullscreen from PelleC - homepage.
After then load the picture from the file with SHLoadImageFile
It's work with gif,jpg,png,ico and bmp
So you get a handle to a bitmap and show it with StretchBlt.

Kaljj


ml1969

  • Guest
Re: How to show PNG Images with no window?????
« Reply #5 on: September 22, 2009, 05:55:20 AM »
Hello,


(I´m also from germany  :D )

The fullscreen-sample requires the aygshell, which is NOT represented on an PNA (wince 5)
This is a problem I meet sometimes, this makes some problems much difficult.


Michael

Kaljj

  • Guest
Re: How to show PNG Images with no window?????
« Reply #6 on: March 10, 2010, 08:08:15 PM »
Hello Michael,

have you found a way to show the PNG.
i have read in the last time about the GAPI.
Look at the MSDN there show you a example to
write direct to the screen-memory

I hope i'm not to late  ;D

good luck
Kaljj