Barry01
asked on
Image editor Resizing
I am working on an image editor in visual c++. I want to resize the image.
so what will be code for that.
so what will be code for that.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sure.
Scaling an Image
http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/psdk/gdi/bitmaps_5y1x.htm
Scaling an Image
http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/psdk/gdi/bitmaps_5y1x.htm
ASKER
will there be same procedure if I want to resize the frames of an .avi file so that the avi file is resized.
That's a different story. Are you playing the AVI file? Or are you editting the AVI file?
ASKER
I am compressing the avi file and while doing that I want to resize it.
ASKER
also I am using the structure bitmapinfoheader.
ASKER
actually it's avistreaminfo
Yes, you can resize it. But there is no need to resize it since the AVI can be resized easily when being played.
ASKER
how to do the resizing of the avi
When using the MCIWnd window class to play an AVI, simply use the MCIWndPutDest macro.
ASKER
If I want to compress it and save it in the different size.
Then you resize the bitmaps of each frame using those functions.
ASKER
what is that HDC handle in the StretchDIBit function and how to use it
StretchDIBits resizes the DIB and displays the result to the device context specified by the HDC. You may use a memory DC to hold the result.
ASKER
How to use it and then copy the result to the bitmapinfoheader
It seems that you are not familiar with Windows GDI functions. I would suggest you take a look at the documentation/samples and some books on GDI first. Otherwise, it is difficult for you to write an image editor.
ASKER
actually the program is already written and I just want to add this function into it.
ASKER
AVIStreamReadFormat(m_apst AviStreams [iStream], 0, &m_abyBuffer, &lSize);
lpBmpInfoHdrOld = (LPBITMAPINFOHEADER)&m_aby Buffer;
can we change the width and breadth of this lpBmpInfoHdrOld with that function.
lpBmpInfoHdrOld = (LPBITMAPINFOHEADER)&m_aby
can we change the width and breadth of this lpBmpInfoHdrOld with that function.
It is not so easy. You have to extract each frame, resize it and assemble them again. The following sample is useful to you.
AVIedit: Editing APIs in AVIfile
http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/devprods/vs6/visualc/vcsample/vcsmpaviedit.htm
Class for writing your own AVI-Files
http://www.codeguru.com/multimedia/writeavi.shtml
An auto-sizing bitmap picture control
http://www.codeguru.com/bitmap/bitmap_picture.shtml
AVIedit: Editing APIs in AVIfile
http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/devprods/vs6/visualc/vcsample/vcsmpaviedit.htm
Class for writing your own AVI-Files
http://www.codeguru.com/multimedia/writeavi.shtml
An auto-sizing bitmap picture control
http://www.codeguru.com/bitmap/bitmap_picture.shtml
ASKER
can you give me the outline of function to perform this I will try to implement it.
You may first try extracting frame bitmaps from an AVI and assembling them into an AVI without any modifications. Next, you may try doing some operations on the bitmaps.
ASKER
also if you can elaborate the code little bit more thanx.