|
Not exactly but you can decrement them.
|
|
|
|
|
m_list.InsertItem(i,NULL,i);
I wrote like this, though no text, it still reserve the line for text, so I can't align the image well, how to take off the reserved line for text?
|
|
|
|
|
GetThumbnailImage return Image,
but CImageList dones't support Image, but CBitmap.
How to list thumbnails in CListCtrl, I want to support as many formats as GDI+ supports, and because other codes are using GDI+, I'd not to use another library.
|
|
|
|
|
Bitmap bmp(...) // using a jpeg file here
Bitmap *pBmp=(Bitmap *)bmp.GetThumbnailImage // the cast works well
Is it safe?
|
|
|
|
|
Hi,
i am using Visual Studio 2005. The problem I have is when i select VC++ and MFC application, I am giving a name to the application as ExamSchedule.
In the Sourcefiles.. I am able to see ExamScheuledoc.cpp,ExamScheduleview.cpp and ExamSchedule.cpp. I am adding few controls on to the dialog and doubleclicking on the dialog. So a new popup asking for cpp and .h file for that dialog is coming.
Should I give a new class name or the browse ExamSchedule.cpp file name which is already created.
Also when I am giving new .cpp and .h file, the program is not executing.
Plz let me know how to proceed.
Thanks,
Sai
|
|
|
|
|
What do you want to do and did you get any error when it deosnt work?
|
|
|
|
|
Hi everyone!
Few weeks ago I started to work on private CNC machine project. I’ve done a lot of design work using ProE. Now I am getting into control part. I am using Stepper Motors, which have to be controlled via Parallel Port.
My intent is to make software, which can send impulses on Parallel port pins with desired frequency. I can use Windows built-in timer but it is not enough accurate, I need more than 1000 Hz. For my machine I need something like 45000 Hz or more. I tried to use QueryPerformancecounter using while loop, but it use my CPU a lot. Is there any more accurate timer than 1 ms, which can call Event in windows, like Windows TTimer does? Is it possible to use QueryPerformance Timer or RDTSC, as Event Recalling functions? I am using Visual C++ 2005.
I look forward to your reply.
Best regards
Szymon
|
|
|
|
|
If your target platform is windows, then you can forget your idea: Windows is not a real-time operating system. Which means that you will never be able to have such an accuracy. You'll need to use a real-time operating system for that purpose.
|
|
|
|
|
Ok.
So what would you propose? What kind of system am I able to use?
What do you think about this kind of software (Mach2, Mach3, http://www.artsoftcontrols.com/artsoft/index/index.htm) or KCAM. They are installed on windows platform and intended to use to control Stepper Motors via Parallel Port. I can use them of course and I will as last chance but I would rather create something own.
I don't necessarily need Real Time control. I need any possibility to tact Parallel Port Pins with given frequency. Just every help is appreciate...
Thank you
Szymon
|
|
|
|
|
how can i convert bmp image to pdf ?
|
|
|
|
|
|
|
Google for Infra Recorder. I do not know if it is C++, but it works great.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
Because GDI+ support many formats and there is a function Image::GetThumbnailImage.
Is GDI+ not designed not very compatible with MFC?
So not convenient?

|
|
|
|
|
GDI+ is perfectly compatible with MFC.
It would be silly to wrap GDI+ classes in MFC classes since GDI+ already has a
class-based interface.
The list-view control is the problem. It has no built in functionality for displaying
thumbnail images. There's lots of articles showing how a list-view control can be
enhanced to provide this functionality.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks.
I'll search it agian.
|
|
|
|
|
Hint: Google "CListCtrl thumbnails"
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: It would be silly to wrap GDI+ classes in MFC classes
I beg to differ.
The GDI+ C++ wrapper classes are absolutely horrible from a MFC programmers perspective. Another MFC-ish wrapper makes life so much nicer even if it costs a tad bit in performance.
Just my two cents
|
|
|
|
|
Which one do you mean?
CxImage?
|
|
|
|
|
Here is the error Infomation:
error C2228: left of '.GetHBITMAP' must have class/struct/union type
Bitmap bmp(LPCTSTR(FilePath));
Color clr(255,0,0,0);
HBITMAP hBmp;
bmp.GetHBITMAP(clr,&hBmp);
CBitmap *pBmp=new CBitmap;
pBmp->FromHandle(hBmp);
PS: why Gdiplus::Black can't be used to replace clr here?
|
|
|
|
|
Maybe something like this...
Bitmap bmp(LPCTSTR(FilePath)); <font color="Red"><-- what's this? A WCHAR * is expected here, not a LPCTSTR</font>
HBITMAP hBmp;
bmp.GetHBITMAP(Color::Black, &hBmp);
CBitmap *pBmp=new CBitmap;
pBmp->Attach(hBmp); <font color="Red">//<-- attaching more permanent than FromHandle()! Check the docs!</font>
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
all right
But what about the error C2228?
|
|
|
|
|
Missing a header file for GDI+?
It compiles here.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Which in the stdafx.h
<br />
#include "gdiplus.h"<br />
#pragma comment(lib,"gdiplus.lib")<br />
using namespace Gdiplus;<br />
|
|
|
|
|
followait wrote: Bitmap bmp(LPCTSTR(FilePath));
The problem is there, which is why I commented on it in red.
What is FilePath? Whatever it is, it needs to be a WCHAR* or converted to a WCHAR*.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|