|
Not sure (been a while since I used GDI), but maybe you should create a compatible bitmap and select it into the device context before drawing to it?
|
|
|
|
|
I have a simple (I hope) question.
I have a disk full of jpg images and just want to pull the jpeg attributes from the file, resolution, etc.
The current program, in C++/MFC, looks for duplicate files, and I want to add a pop-up with jpeg info.
I looked at the ImageFormat class and also jpegLib, but they seem more concerned with manipulating the image data itself, rather than the attributes.
If anyone can suggest a starting point that would be great.
Also, if anyone knows of anything to pull the EXIF properties from the file, that would be just excellent.
Thanks in advance,
Bryan.
|
|
|
|
|
i think GDI+ will let you get all that stuff.
our libs will do it, too...
|
|
|
|
|
this[^] is what gets used to obtain a specific image property (e.g. JPEG EXIF field) when using .NET; and I expect it is based directly on similar capabilities inside GDI+. The mapping between items and item numbers I once found using Google...
HTH
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hey, thanks for that Guys,
that really gave me the start that I needed, got it half coded already....
Thanks Again,
Bryan
|
|
|
|
|
Hi,
I've a bitmap file binary data in variable (File contents read from a .bmp file). How can i convert it to an HBITMAP?
I know One way is to save the contents in to a file and use LoadImage() method. Is there any other way to do the same in memory ?
Thanks & Regards
|
|
|
|
|
|
Hey,
Check out this MSDN arcticle on creating a bitmap in memory (inside a device context).
Capturing an Image[^]
Hope that gets you started.
Best Regards,
MicroVirus
|
|
|
|
|
Hi
I have created an interface in interface.h file as below
class Manager ;
class IManager
{
public :
virtual void __stdcall fun(Manager* ptr)=0 ;
};
Manager class is declared in another sourceFile.h
#include "interface.h"
class Manager
{
public :
Manager () ;
~Manager () ;
IManager* GetMyManager () ;
IManager* _VarManager ;
};
I have provided forward declaration of class Manager in interface.h .When I try to compile my project it fails with an error "Ambigious Class Manager"
|
|
|
|
|
For starters, verify you have include guards in your header files.
#ifndef _MANAGER_H_INCLUDED
#define _MANAGER_H_INCLUDED
#endif
or
#pragma once
Also check that you don't include another header, that in turn includes a file defining a Manager class.
|
|
|
|
|
Posted should compile. You should post also the relevant source(s) file.
As already suggested you should also guard your header aggainst multiple inclusion.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
pandit84 wrote: "Ambigious Class Manager"
Could you quote the precise text of that message please? The error number might help, too.
My first guess is that the error is not related to your definition of Manager and IManager at all. More likely, either you have a clash of namespaces (e. g. you might have multiple classes called Manager in different namespaces; maybe even a forward declaration outside the correct namespace could cause it), or you derived classes from Manager using multiple inheritance. The latter can be a problem if you inherit Manager via multiple paths, causing inheritance ambiguity.
See here (under "Pointer conversions") for an example of the inheritance ambiguity.
|
|
|
|
|
Thanks a lot for your reply. Solved , it was a namespace clash. Thanks stefen
|
|
|
|
|
Yay, a stab in the dark, and a hit!
It does confirm my general tactic of actually reading the error message before bothering to look at the code.
|
|
|
|
|
I want to preview doc file using CreateFromFile of COleClientItem.Tis method takes COleDocument object as argument.
Sometimes CreateFromFile success and i can see the preview but sometimes it's fail for same file. I did not understand the reason why. Can someone guide me? Is there any memory problem?
Also if i have office 2003 installed at my system and to open ofice 2007 file i installed utility provided by microsoft.
Using CreateFromFile if i want to preview office 2007 file then CreateFromFile failed. But in some cases it's succeed and i see the file name in preview contents.How to see the actual contents? Should i use any other function in this case.
|
|
|
|
|
Are you initializing the OLE libraries?
|
|
|
|
|
I used CoInitialize(NULL) and AfxEnableControlContainer(); in InitInstance.
Is there something else which i sould do
|
|
|
|
|
Try calling AfxOleInit() in InitInstance.
|
|
|
|
|
AfxOleInit did not solve the problem.
Let me describe in details how i am doing
i create a mfc dll.In this dll i create below classes
class CDocData : public COleDocument
class CEmbedWordCntrItem : public COleClientItem
class CViewData : public CView
Is there any example for createfromfile
modified on Thursday, April 14, 2011 4:15 AM
|
|
|
|
|
I would like to retrieve week number from a given year, month and day. I guess it's something with the tm and time_t structs but I can't figure it out. I'm looking for a function like this:
int Week(int year, int month, int day)
{
int week;
return week;
}
Thanks for any help!
|
|
|
|
|
|
|
My attempt:
int week(int year, int month, int day)
{
int wk;
struct tm nyd, id; int fs;
nyd.tm_hour=12;
nyd.tm_min = 0;
nyd.tm_sec = 0;
nyd.tm_mday = 1;
nyd.tm_mon = 0;
nyd.tm_year = year-1900;
mktime(&nyd);
id.tm_hour=12;
id.tm_min = 0;
id.tm_sec = 0;
id.tm_mday = day;
id.tm_mon = month-1;
id.tm_year = year-1900;
mktime(&id);
fs = 6 - nyd.tm_wday;
if ( fs >= id.tm_yday) return 1;
wk = (id.tm_yday-fs) / 7;
if ((fs + wk*7) >= id.tm_yday) return (wk+1);
return (wk+2);
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
When I compile my program as a release it crashes when I try to run it. However the debug version works.
It doesn't give any specific errors.
Any suggestions?
Thanks.
|
|
|
|
|
Cyclone_S wrote: Any suggestions?
yes, three of them:
1. make sure you have adequate problem logging within your app; every exception should be logged; every API call should have its return value checked, and abnormalities need logged.
2. read Surviving the Release Version[^]
3. read Debugging Release Mode Problems[^]
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|