| View previous topic :: View next topic |
| Author |
Message |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Wed Aug 19, 2009 12:10 pm Post subject: [WINAPI] GDI + JPG? |
|
|
How to render a JPG with GDI to screen? It seems that BI_JPEG doesn't support screen rendering, only printing.
I don't want to use external libraries, nor GDI+.
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Aug 19, 2009 7:46 pm Post subject: |
|
|
I'm not so sure there is any native support for this in GDI. You may be stuck doing the conversions manually.
You could also try DirectX or OpenGL. I don't have much experience in OGL, but it's really quite trivial to do in DX. Plus you get basically what amounts to free scaling, moving, rotating, etc.
ID3DXSprite handles all the hard work for you and it's probably about as fast you can hope to get. I get over 10,000(!!!) fps according to EVGA precision when drawing a single sprite in a window on my system. I'm not sure how correct it is, but I'm inclined to believe that it's close since I can audibly hear the coil whine coming from my video card - crazy.
edit: looks like in OGL you have to manually load the image yourself if you don't want to use anything to help. Loading something like a bitmap is dead simple but I have no idea how to handle a jpeg.
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Thu Aug 20, 2009 11:21 am Post subject: |
|
|
| slovach wrote: | | You could also try DirectX or OpenGL. | Overkill for a simple Windows app. Besides those could be considered as external libs..
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Thu Aug 20, 2009 7:23 pm Post subject: |
|
|
| Jani wrote: | | slovach wrote: | | You could also try DirectX or OpenGL. | Overkill for a simple Windows app. Besides those could be considered as external libs.. |
mm, typically you'd be hard pressed to find a windows install without directx, i think.
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Fri Aug 21, 2009 5:17 am Post subject: |
|
|
| slovach wrote: | | Jani wrote: | | slovach wrote: | | You could also try DirectX or OpenGL. | Overkill for a simple Windows app. Besides those could be considered as external libs.. |
mm, typically you'd be hard pressed to find a windows install without directx, i think. :) | Maybe DX7 or sth. But there are still comps without DX9/10, even without DX8...
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Fri Aug 21, 2009 1:23 pm Post subject: |
|
|
| COM :/ Gonna check out the StretchDIBits tho. Oh right, I forgot that display devices don't support BI_JPEG, only printers do.
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Aug 21, 2009 8:43 pm Post subject: |
|
|
| Jani wrote: | | COM :/ Gonna check out the StretchDIBits tho. Oh right, I forgot that display devices don't support BI_JPEG, only printers do. |
I think this may be up to the drivers to support, I'll take a look.
edit:
CreateDIBSection is failing for me when I try to specify JPEG.
|
|
| Back to top |
|
 |
|