Pelles C forum
C language => Tips & tricks => Topic started by: TBD on February 13, 2005, 03:05:57 PM
-
http://www.rsdn.ru/article/qna/gdi/drawimg.xml
even if it is in russian and C++ code, you can find different techniques to load images (JPEG/GIF/PNG/...) using libraries already on the system (OleLoadPicture,GDI+,IImgCtx,DirectXTransform,Direct3D,...)
enjoy :lol:
-
Hi TBD,
Thanks for the link. It would be good to have a translation to english.
I have a little project to display BMPs from files:
http://smorgasbordet.com/phpBB2/viewtopic.php?t=260
-
heya Vortex,
I know the display BMPs from files example =D>
I am interested in displaying embedded PNG images, so I am looking for a solution without the need of external libraries in my exe. now I am using PNGLib (http://www.madwizard.org/view.php?page=downloads)
you can use an online translation service, for example check this translation (http://babelfish.altavista.com/babelfish/urltrurl?lp=ru_en&url=http://www.rsdn.ru/article/qna/gdi/drawimg.xml)
it would be nice to have the example translated to PellesC :roll:
-
The attached file should work - it uses the IImgCtx interface (from mshtml.dll). It will display images using an URL, so local files or web files will both work. If this works for you too, I will add it as a sample to the source code section...
Pelle
-
thanks Pelle !
you should add this to remove the flicker on resize:
case WM_ERASEBKGND:
return 1;
it is possible to use relative paths instead of fixed ? I tried with file://./test.png and doesn't work (I have the test.png in .exe dir :lol: )
... now I must found the way to load the image from memory instead of URL :roll:
-
you should add this to remove the flicker on resize:
case WM_ERASEBKGND:
return 1;
a) it's a sample
b) the text output will look terrible...
it is possible to use relative paths instead of fixed ? I tried with file://./test.png and doesn't work (I have the test.png in .exe dir :lol: )
Not a clue - I have very little information about limitations, requirements, supported formats...
Pelle
-
Here is a tiny example using Ernest Murphy's image library. It can handle JPG, BMP, GIF and WMF images.
-
Hi friends,
There was a local bug in Ernest Murphy's image displaying function BitmapFromFile.asm
Thanks to El_Choni for discovering and fixing this bug:
http://board.win32asmcommunity.net/viewtopic.php?t=10650
f0dder suggested fixing another bug found in BitmapFromMemory.asm
http://board.win32asmcommunity.net/viewtopic.php?p=145356#145356
This second improved version uses the BitmapFromFile.asm function simplifying the job.