Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[WINAPI] GDI + JPG?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Wed Aug 19, 2009 12:10 pm    Post subject: [WINAPI] GDI + JPG? Reply with quote

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
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Aug 19, 2009 7:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Thu Aug 20, 2009 11:21 am    Post subject: Reply with quote

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
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Aug 20, 2009 7:23 pm    Post subject: Reply with quote

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. Smile
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Fri Aug 21, 2009 5:17 am    Post subject: Reply with quote

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
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Fri Aug 21, 2009 12:22 pm    Post subject: Reply with quote

http://www.codeproject.com/KB/graphics/load_jpeg__gif_resource.aspx

http://www.catch22.net/node/129

_________________
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Fri Aug 21, 2009 1:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Aug 21, 2009 8:43 pm    Post subject: Reply with quote

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. Neutral
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites