|
Have you tried GetActiveView( )? This function is a member of CFrameWnd so you should have access to it in your CMainFrame class. Note that you'll have to typecast the return value to CListForm*
Hope this helps.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Is there any small (really small) library or tip to convert a bmp file to jpg?
I mean, not a huge kind of classes or libraries at once. Just a single header file or some C that makes it without MFC ?
Regards.
|
|
|
|
|
LibJPEG is 90Kb when compiled, CxImage with CXIMAGE_SUPPORT_JPG only will be about 110K.
|
|
|
|
|
|
Ok, i have the jpeglib.lib library file, can you tell me how to convert the bmp to jpg now?
Regards.
|
|
|
|
|
I use jpeg library a lot, it's pretty easy. Check out the docs, Google up some sample code from the many packages that use it. Here is a small sample of compressing an image to a monochrome jpeg:
(A bit of code is always good. I stripped out a lot of particulars.. mostly error handling setup. Use this example as a source of good keyword combos in Google.)
bool JPEGCompressMono(FILE* Out,int Quality,unsigned char* pSrc,int Width,int Height)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr err;
cinfo.err = jpeg_std_error(&err);
jpeg_create_compress(&cinfo);
jpeg_stdio_dest(&cinfo,Out);
cinfo.image_width=Width;
cinfo.image_height=Height;
cinfo.input_components=1;
cinfo.in_color_space=JCS_GRAYSCALE;
jpeg_set_defaults(&cinfo);
jpeg_set_quality(&cinfo,Quality,TRUE);
jpeg_start_compress(&cinfo,TRUE);
int Slop=(Width%4)?4-Width%4:0;
JSAMPROW row_pointer[1];
while (cinfo.next_scanline < cinfo.image_height)
{
row_pointer[0]=pSrc+(Height-1-cinfo.next_scanline)*(Width+Slop);
jpeg_write_scanlines(&cinfo,row_pointer,1);
}
jpeg_finish_compress(&cinfo);
jpeg_destroy_compress(&cinfo);
return true;
}
|
|
|
|
|
allright, but what if i need to convert a file for example it should be some function
that takes as argument 1 an output file and as for argv[2] the input file for example and does the dirty thing. isnt there something like this?
cause all i get in my program is a handle to the bitmap. nothing else, and i want to convert that bitmap to jpg. or even, i can save it to a bmp file and then for example i want to convert that bmp file to jpg.
all i see is that in the declaration of the RGBToJpegFile(...) there is a BYTE *data.
i have no idea what to do with it when i have a handle to bitmap / bmp filename.
|
|
|
|
|
If you have a handle to the bitmap, use GetObject with a DIBSECTION struct to find the bitmap bits (assuming handle is to a DIB section). If the handle is not to a DIB, use CreateDIBSection to create one, select it into a temporary DC and blit the bitmap into your DIB, then proceed. If the image is in a file, just read it into a space on the heap. (or map it into memory if truly large...)
|
|
|
|
|
If you are using MFC 7.0 (that is Visual Studio .Net) check
out the CImage class which should serve your purpose.
|
|
|
|
|
Hi, im writing a program for an FPGA controller in c++ at uni. Since i wanted to make a GUI, i've been using MFC and have found it relatively easy with all the toolbar drag and drop functions. Although, when i run it at university, the machines that dont have VC++ but have Borland C++, cause a problem for the MFC exe file due to the absence of libraries etc. A friend reccomended that using a WIN32 API dialog would be better as it wouldnt be as dependent on computer config as the MFC application. Im fairly new to Visual C++ and hence i cant say im very clear on making a a dialog based application in Win32. Moreover, id rather stick to MFC, its seems easier. Is there anyway of solving this problem? can one stick to MFC, but still design a dialog based application that will work on almost every computer? Also, can anyone provide links to win32 dialog based apps tutorials?
Cheers,
Ayush
|
|
|
|
|
You can do a static linking and see if that works
Regards,
Venet.
Donec eris felix, multos numerabis amicos.
|
|
|
|
|
Could someone explain how one goes about static linking?
|
|
|
|
|
Go to Project and Settings, you should find it there somewhere.
Can't remember the exact tabs as I don't use MFC.
Regards,
Venet.
Donec eris felix, multos numerabis amicos.
|
|
|
|
|
Go to the Project Settings, click on the General tab, and select "Use MFC in a static library". Doing so, you don't need at all MFC dlls to run it on target machines.
How low can you go ? (MS rant)
|
|
|
|
|
Hi,
I would like to add a new feature to my GUI: user resizeable controls. I already have a resizeable CDialog, now there are inside two CListbox next to each other. If I resize the one the other should become smaller (and visa versa, e.g. similar to the explorer window). It looks like this:
--------------------------
| | |
| | |
| | |
| | |
| | |
---------------------------
^listbox1 ^listbox2
^
let user resize here with mouse
Two question............
What is the general technique to do this? Is this a SplitterWindow?
Is there already a class on CodeProject?
Thanks for pointing me into teh right direction!
|
|
|
|
|
PS: There are also more controls in the dialog.
Not that you think my dialog consists of two listboxes only (dunno if this is important to mention). However, the two listboxes are the part that the user should be able to resize. The overall width of both listboxes should stay the same. Thanks... and im curious, how this can be done.
|
|
|
|
|
PPS: It's totally NOT urgent... so if you read my posts and have a hint, I appreciate any help. Meanwhile I spend my weekend on reading MSDN and what I found here.
|
|
|
|
|
The new UI elements that are present in VS.NET (and also in Office XP), such as the menus that are all white with the translucent blue highlighter, toolbars with the translucent blue highlighter, and tabbed documents with similar features are all rather slick. Are these elements and styles available to us mortals or is Microsoft doing a ton of custom control work? Anyone have an links that detail how all of this can be integrated into our apps?
thanks
|
|
|
|
|
Where can i find the documentation abour the registerd MFC ActiveX controls? Not about the creation and usage of the controls. Just i want the documentation like the class definition and purpose of the memeber functions and data memebers etc. Please help.
|
|
|
|
|
Hi,
Is there any COM interface that can be used for image editing (eg: selection,erase,fill etc.. all options available in Windows paint application)?
Thanks
Neha
|
|
|
|
|
Not that I am aware of, are you trying to stay standard so that other people can interface into your progranm. or are you trying to hook into MSPaint?
If you are creating your own program, I think that you would be fine to create your own interface.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
can i type caste WPARAM and LPARAM into Int32 or not.
is there any lose of values;
Int32 wp=(Int32)wParam;
Int32 lp=(Int32)lParam; is there any lose of value if i get wParam,lParam like that?
WPARAM wParam=(WPARAM)wp;
LPARAM lParam=(LPARAM)lp;
r00d0034@yahoo.com
|
|
|
|
|
WPARAM and LPARAM are 32-bit integers, however depending on the exact message, they may be signed or unsigned. So without knowing the origin of the values, it's impossible to say whether assigning them to signed int variables could lose data.
Note that in 64-bit Windows, they are 64-bit integers.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
i want to store thes values.
that can be put into
system.collection.hashtable and can be retrive again
but in case of wparam and lparam these values cant be retrive again ?
so what yo do ?
any suggestion.
r00d0034@yahoo.com
|
|
|
|
|
I have a little problem here maybe someone can help me please. I have to provide a Programmer class which is a sub class of both Person class and the Staff class. I have done simple inheritance but I don’t know much about multiple inheritance. Can anyone please help me with initial part of the program. Here are the Person.h and Staff.h file:
Person.h
#ifndef __PERSON_H
#define__PERSON_H
class Person{
Protected:
char* name;
int age;
Public:
Person(char*, int);
Person(const Person&);
Person& operator=(const Person&);
~Person();
char* getName();
int getAge();
};
#endif
&&&&&&&&&&&&&
Staff.h
#ifndef __STAFF_H
#define__STAFF_H
class Staff{
Protected :
Char* post;
Public:
Staff(char*);
Staff(const Staff&);
Staffoperator=(const Staff&);
`Staff();
char* getPost();
};
#endif
// thanks for replying
|
|
|
|