GDI+ concern???????
-
TooShy2Talk wrote:
Graphics gr(bmpTemp)
(One overload of )The
Graphics
constructor accepts a pointer to aCImage
object.DrawImage
(as well asRotateTransform
) is a method of theGraphics
class. :)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]But how will I declare bmpTemp?
????????? Graphics gr(bmpTemp)
I'm confused on how will I declare this one. Can yu please show. Thank you. -
TooShy2Talk wrote:
Graphics gr(bmpTemp)
(One overload of )The
Graphics
constructor accepts a pointer to aCImage
object.DrawImage
(as well asRotateTransform
) is a method of theGraphics
class. :)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]I have tried
Image *bmpTemp; Graphics gr(bmpTemp); .... stitching here
but result to following error,bmpTemp is being used without being defined.
I don't really know how to implement it. -
But how will I declare bmpTemp?
????????? Graphics gr(bmpTemp)
I'm confused on how will I declare this one. Can yu please show. Thank you.Did you look at the link i gave. It shows a graphics constructor which accepts Image class object as a parameter. Bitmap class is derived from the Image class. So when you will pass the Bitmap object to the graphics constructor it would invoke that constructor. Now declaration of bitmap. You can simply create a canvas bitmap which will hold your other bitmaps someting like this. Bitmap *bmpTemp = new Bitmap(iWidth,iHeight); Is it clear now???
Regards, Sandip.
-
I have tried
Image *bmpTemp; Graphics gr(bmpTemp); .... stitching here
but result to following error,bmpTemp is being used without being defined.
I don't really know how to implement it.For instance
CImage bmpTemp;
bmpTemp.Create(640,400,32);
Graphics gr(& bmpTemp); // please note the ampersandBitmap bmpTemp(640,400, PixelFormat32bppRGB);
Graphics gr(& bmpTemp);Did you follow the link provided by Sandip? Have you a good
C++
tutorial? :)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]modified on Tuesday, September 9, 2008 4:41 AM
-
For instance
CImage bmpTemp;
bmpTemp.Create(640,400,32);
Graphics gr(& bmpTemp); // please note the ampersandBitmap bmpTemp(640,400, PixelFormat32bppRGB);
Graphics gr(& bmpTemp);Did you follow the link provided by Sandip? Have you a good
C++
tutorial? :)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]modified on Tuesday, September 9, 2008 4:41 AM
Yes, I have tried also CImage bmpTemp; but there is no intellisense for .Create() bmpTemp.Create(); I have tried including altimage.h but it comflicts to other class I'm using. Or is there other header to include?
-
Yes, I have tried also CImage bmpTemp; but there is no intellisense for .Create() bmpTemp.Create(); I have tried including altimage.h but it comflicts to other class I'm using. Or is there other header to include?
TooShy2Talk wrote:
CImage bmpTemp;
I dont know if CImage is derived from Image. But you can use
Image *bmpTemp = new Image(iWidth,iHeight);
Did you try this?? I don't know why are you facing so much trouble in this Previously you were using hDC directly to draw your bitmaps on. Now you just have to replace this hDC with temporary bitmap.. and once you finish all your operations do following
Graphics gr(hDC);
gr.RotateTransform(..);
gr.DrawImage(bmpTemp);Is it clear?
Regards, Sandip.
-
TooShy2Talk wrote:
CImage bmpTemp;
I dont know if CImage is derived from Image. But you can use
Image *bmpTemp = new Image(iWidth,iHeight);
Did you try this?? I don't know why are you facing so much trouble in this Previously you were using hDC directly to draw your bitmaps on. Now you just have to replace this hDC with temporary bitmap.. and once you finish all your operations do following
Graphics gr(hDC);
gr.RotateTransform(..);
gr.DrawImage(bmpTemp);Is it clear?
Regards, Sandip.
SandipG :) wrote:
But you can use Image *bmpTemp = new Image(iWidth,iHeight);
I received an error on this, I think there is no constructor available.
-
For instance
CImage bmpTemp;
bmpTemp.Create(640,400,32);
Graphics gr(& bmpTemp); // please note the ampersandBitmap bmpTemp(640,400, PixelFormat32bppRGB);
Graphics gr(& bmpTemp);Did you follow the link provided by Sandip? Have you a good
C++
tutorial? :)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]modified on Tuesday, September 9, 2008 4:41 AM
I have successfully created the following lines
CPallini wrote:
CImage bmpTemp; bmpTemp.Create(640,400,32);
But encountered an error on the line below.
CPallini wrote:
Graphics gr(& bmpTemp);
Error is "Cannot convert CImage* to HDC".
-
SandipG :) wrote:
But you can use Image *bmpTemp = new Image(iWidth,iHeight);
I received an error on this, I think there is no constructor available.
TooShy2Talk wrote:
Image *bmpTemp = new Image(iWidth,iHeight);
I am nt sure if constructor is available for the Image class but it is surely there for Bitmap. What is the problem you facing in following code.
Bitmap *bmpTemp = new Bitmap(iWidth,iHeight);
Graphics gr(bmpTemp);If you still have problems Please Look at this section on CP GDI+[^] I hope it will help you..
Regards, Sandip.
modified on Tuesday, September 9, 2008 4:40 AM
-
Yes, I have tried also CImage bmpTemp; but there is no intellisense for .Create() bmpTemp.Create(); I have tried including altimage.h but it comflicts to other class I'm using. Or is there other header to include?
You're right: I made confusion, I'm sorry about. I've modified my previous post. Hope it helps. :)
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] -
You're right: I made confusion, I'm sorry about. I've modified my previous post. Hope it helps. :)
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]Finally, it WORKS. Thank you very much. It's a big help. Till my next question. :laugh: :laugh:
-
Finally, it WORKS. Thank you very much. It's a big help. Till my next question. :laugh: :laugh:
I'm very sorry for the delay due to my mistakes. :)
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]