|
-
July 30th, 2006, 12:17 AM
#1
How To Display .png
Alright, I have a .png I want to load into a .dll so it will show up when I inject it into a game. How can I load a .png?
-
July 30th, 2006, 02:40 AM
#2
Re: How To Display .png
 Originally Posted by Rehorav
Alright, I have a .png I want to load into a .dll so it will show up when I inject it into a game. How can I load a .png?
To display a PNG file in dialog box, do the following in the OnPaint
function of the dialog. Have a CStatic control in the dialog where the file
is to be displayed.
Code:
.h file
CStatic m_Pic
Code:
.cpp file
OnPaint(...)
{
...
CPaintDC dc(CWnd::FromHandle(m_Pic.m_hWnd));
CGdiplusPicture pic;
pic.LoadPicture(strPathToPNGFile);
pic.Render(dc.GetSafeHdc(), rcRender, 0L);
....
}
Edit :Have you tried GDI+
Last edited by jayender.vs; July 30th, 2006 at 02:43 AM.
Reason: Added info
It takes seconds for rating…that actually compensates the minutes taken for giving answers
The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
Regards, Be generous->Rate people
Jayender!!
-
July 30th, 2006, 02:53 AM
#3
Re: How To Display .png
Well, I need to load the .png, like stored as a resource, and be able to place it in co-ords X,Y. Its not in a dialog box, but I'm injecting the .dll into a game and I want to have the .png display when its injected.
-
August 2nd, 2006, 08:37 PM
#4
Re: How To Display .png
Your .dll has already been ready for your case ??
You just wanna realize loading your .png file by using .dll to inject into a game , right ????
If I have not understand your case yet , pls. attach your project with zip format here .
Little by little one goes far
Keep moving.......!
Nothing is impossible !
-
August 3rd, 2006, 02:45 AM
#5
Re: How To Display .png
Hi,
You can use either GDI+ as mentioned by jayender.vs or you can take a
look at a free open source library called CxImage if you need to do raw
processing of the image data.
-
August 3rd, 2006, 03:41 AM
#6
Re: How To Display .png
If you need to load a png from your resource file, it's a little more involved but you can do it with GDI+. Let me know if you want me to post some code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|