[source] Loading images using different techniques

Started by TBD, February 13, 2005, 03:05:57 PM

Previous topic - Next topic

TBD

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:

Vortex

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
Code it... That's all...

TBD

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

you can use an online translation service, for example check this translation

it would be nice to have the example translated to PellesC  :roll:

Pelle

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
/Pelle

TBD

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:

Pelle

Quote from: "TBD"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...

Quote from: "TBD"
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
/Pelle

Vortex

Here is a tiny example using Ernest Murphy's image library. It can handle JPG, BMP, GIF and WMF images.
Code it... That's all...

Vortex

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.
Code it... That's all...