|
|
Comments and Discussions
|
|
 |

|
i am particularly new to c++, all my programs are black background elementary programs. please show me how to create windows with buttons that u can actually press and with spaces that you can write to. (generall, i'd like to know about real-world applications and animation) can anyone please help
s. phakoe
|
|
|
|

|
As I told you, you're asking in a forum dedicated to a specific article. You're also asking questions that you can answer yourself, with google. If you're this new, you should buy a book and work through it. Then, you should take your questions to the Visual C++ forum, not in the forum for articles not related to your question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|

|
can anyone please show me how to create, display, and use images in c++
|
|
|
|

|
You should ask this in the C++ forum, after you use google a bit to find your own info. CBitmap is the class in MFC for an image. If you google that, you should find heaps of info.
You'd also need to define 'use'. Do you want to draw on an image ? Process it somehow ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|

|
Thanks. by use, i just mean generall to do anything doable to images, (move them, create, etc) anything
|
|
|
|

|
OK, you're well into the world of 'google it first'. You're asking broad and easy to answer questions.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|

|
is anyone out there knows the c++ coding for image morphing?thanks alot
|
|
|
|
|

|
Hello,
I am displaying a grayscale image by calling:
SetDIBitsToDevice( CloneScrDC.GetSafeHdc(),
ptDst.x, ptDst.y,
m_param->m_cx, m_param->m_cy,
m_lScrollX, 0,
m_lScrollY, m_param->m_cy,
topbits,
m_param->m_bmi,
m_param->m_coloruse);
Where m_param store pixel info.
But now I would like to display white pixel in Red and Black pixels in Blue, I used CloneScrDC get/setpixel to display Red and Blue color but it is way too slow. Anybody has some great ideas?
Thanks in advance.
Please reply to LeoAngelReliable@yahoo.com.
LeoAngelReliable@yahoo.com
|
|
|
|

|
If I use the class CBitmap?
|
|
|
|

|
How To set picture as background of a scrolling window using MFC
|
|
|
|

|
Please help to find a bitmap editor like used in MFC
my mail is alex_kuleshov@hotmail.com
|
|
|
|
|

|
Hi All, GetPixel(iX,iY) does not work correctly. If iY == 0 you raise an exception, if not you get the pixel from the row below the one you're looking for. Below is the solution. Change this code in dib.cpp: -- begin code change RGBQUAD CDib::GetPixel(int iX, int iY) { RGBQUAD rgbResult; WORD wDummy; //takeinto account that DIBit raws are reversed vertically iY = m_pBMI->bmiHeader.biHeight - iY; //assert pixel position
To this: RGBQUAD CDib::GetPixel(int iX, int iY) { RGBQUAD rgbResult; WORD wDummy; //takeinto account that DIBit raws are reversed vertically iY = m_pBMI->bmiHeader.biHeight - iY - 1; //assert pixel position -- end code change I can't believe this hasn't been picked up before.
|
|
|
|

|
Hello,
i need to get some portion of pDC(displayed on the single document) from gove x,y coordinates and rotate that portion of pDC and then display the same image on the single document's screen i.e. on pDC;
Could any bdy please help me out
|
|
|
|

|
Hello,i have to rotate a CDC object getting it from pDC and displaying it back on the pDC i used SetWorldTransform from msdn but its not working can i send u the code and will u please check this
|
|
|
|

|
There is code on CP to do this already.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|

|
I keep getting this error when trying to use the CDIB class:
dib.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const CDib::`vftable'" (__imp_??_7CDib@@6B@)
I belive its related to a DLL file
what can I do??
please help for it is very urgent!!!
thanks
Yair
|
|
|
|

|
Don't use a dll, use Chris Maunders DIBSection wrapper instead.
|
|
|
|

|
Hi all
I am trying to capture the live video from CStatic control. I do not want to directly access by directX video memory.
Is it possible to get CDib object directly from CStatic Control
|
|
|
|

|
It seems pretty late to join this party. Is it over yet?
Well if somebody is still using the code, could you share with me some of your experience?
First of all, I want to use greyscale bitmap, somehow it turned to be blue-ish and negative, I used debugging and found out the palette was not set correctly for bmiHeader.biBitCount=16, how should I do it?
Secondly, I found this code could read and display the sample bmp file(Elvis.bmp) correctly, but not with the bmp files created by other applications, then I found out that there three (or more?) versions of bitmap info headers: BITMAPCOREHEADER,BITMAPINFOHEADER,BITMAPV4HEADER. It's really confusing.
Could anybody there kindly fix these and let's re-use the code? This part of code is meant to be re-usable anyway, it's a shame to throw good chunk of code away . Java almost re-use all the code been writen and that's why it become so powerful, because it's a result of collective intelligence.
|
|
|
|

|
Zemin wrote:
Java almost re-use all the code been writen and that's why it become so powerful, because it's a result of collective intelligence.
HAHAHAHAHAHAHAHAHAHAHAHA !!!!!
That is the funniest thing I've heard yet.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|

|
i cannot access m_pBMI of CDib even if i can draw the bitmap on the screen. in order to blit onto the screen stretchdibits uses m_pBMI, however when i make explicit calls to m_pBMI it returns NULL. what can be the reason for this?
ersin
|
|
|
|

|
Hello, ersin!
First, pardon me for such a long silence, you know, vacations, etc.
Second, could you be more specific in the problem decription? The code snippet may be of great use here. So far, I ought to say that m_pBMI is protected member of CDib, so it isn't accessible from outside the class. Furthermore, since you successfully read the Dib, m_pBMI mustn't be NULL. BTW, if your code manage to draw it, then it sure isn't NULL, moreover, Width and Height methods directly extract bitmap sizes from m_pBMI, so it cannot be NULL either. I wonder how can you make direct calls to protected member m_pBMI from outside the CDib class, without having compiler errors? It must be some compiler issue or something. Provide some code example on your problem pls.
Best regards, Vsevolod
Vsevolod Gromov
|
|
|
|

|
I am a new user, i can not read a bmp file from the disk, i can not set a pixel. please give me an example
|
|
|
|

|
1) read *.bmp file from disk:
CFile fl;
if( fl.Open( _T("path to your file\your file.bmp"), CFile::modeRead ) )
{
 //Img - CDib class object declared elsewhere
 //make sure it's empty (I don't remember if Read does it implicitly)
 if( Img.IsValid() )
  Img.Invalidate();
 Img.Read( fl );
 fl.Close();
}
2) set bitmap pixels
//variable that holds Red, Green and Blue components of pixel color
RGBQUAD rgbQuad;
//assign color components to create pure light Blue
rgbQuad.rgbBlue = 255;
rgbQuad.rgbGreen = 0;
rgbQuad.rgbRed = 0;
//Img - CDib class object declared and initialized elsewhere
//make sure it's valid, and set pixel color
//iX, iY are int pixel coordinates, just be aware that they
//are fall in Width and Height range.
if( Img.IsValid() )
 Img.SetPixel( iX, iY, rgbQuad );
Vsevolod Gromov
|
|
|
|

|
i don't understand when you said "make sure it's empty (I don't remember if Read does it implicitly)" i got an error "failed to create empty document"
|
|
|
|

|
Hi,
i am trying to build a CToolbar dynamically at run time - how can i load a bitmap
from the file system and pass it to the CToolbar class to use ?
Thanks
|
|
|
|

|
Hi. Considering CToolbar you mentioned above is MFC class, I'd invoke underlying CToolBarCtl methods for loading custom images for toolbar. These are SetImageList, SetDisabledImageList, and SetHotImageList. First is for normal-state button images, meaning of the second and third is straightforward. So entire procedure is as follows:
1) Using API function LoadImage you can read image from file or resource. For performance and simplification reasons you'd better create the whole band images (ie. all button state images in one file or resource, one file or resource of button images per each of three button state: normal, disabled, hot-tracked ).
2) Construct three image list objects, load them with images you'd previously read. CImageList will do the routine job of slicing image band into separate button images.
3) Supply CToolBarCtl object with these ImageLists.
It should work fine, you're free to use images of any supported bit depth.
Vsevolod Gromov
|
|
|
|
|

|
Thank you for your contribution
Vsevolod Gromov
|
|
|
|

|
MLoibl :I always fail to connect to http://surf.to/freeimage ?is it correct?
|
|
|
|

|
link changed:
Freeimage
http://www.6ixsoft.com/
Discussion board
http://freeimage.konexpoint.com/
|
|
|
|

|
Have a look at http://surf.to/freeimage
FreeImage encapsulates PNG, TIFF, BMP, JPEG and many others. Its free also for commercial apps.
Just download and test it
|
|
|
|

|
link changed:
Freeimage
http://www.6ixsoft.com/
Discussion board
http://freeimage.konexpoint.com/
|
|
|
|

|
Try http://freeimage.sourceforge.net/ for FreeImage.
|
|
|
|

|
What I'd really like to see (and can never find) is something like this but that can save and load in PNG format. RLE is too simple for complex bitmaps, and most apps (like Word) persist their pictures in PNG (considering that GIF is too expensive and JPG is too lossy).
Could you consider it for your next release?
Thanks,
John
|
|
|
|

|
PNG is one of the formats supported by paintlib ( www.paintlib.de ). Paintlib does a lot of the stuff this library does, although for some reason transparent blitting in the library does not work. Transparent blitting using paintlib is very easy to impliment though.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|

|
Wow, thanks. Looks like a very cool library.
I'll be playing with it in future weeks.
Thanks again,
John
|
|
|
|
|

|
Could we have a demo project with a compiled executable. Always handy to see the code in action without having to implement a test harness
|
|
|
|

|
No problem! But... Well, It's not really demo project, it's skinned dialog with bitmapped buttons ( based on this bmpext library and yet two more libs invoking it: animator and coolctls ). I don't know where to place other libs to yet. Animator uses multiple worker threads and bmpext. Coolctls uses bmpext, and animator... Moreover, demo project uses template class for hooking to windows to create custom frames... Well, that's it.
Vsevolod Gromov
|
|
|
|

|
I've made demo, added compiled demo, and updated source code for dll.
Vsevolod Gromov
|
|
|
|

|
Hi Vsevolod,
Thanks for a great demo and great library.
Two thumbs up!
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
MFC extension DLL including advanced bitmap usage features
| Type | Article |
| Licence | |
| First Posted | 15 Jan 2001 |
| Views | 213,523 |
| Bookmarked | 61 times |
|
|