Saving CDC to Bmp File
-
I have drawn some lines etc. on a CDC , now can I save this drawing to a Bmp File ?? How ? Thanks in advance ! Abhishek Narula "Learn to appreciate others ... World would appreciate you"
-
I have drawn some lines etc. on a CDC , now can I save this drawing to a Bmp File ?? How ? Thanks in advance ! Abhishek Narula "Learn to appreciate others ... World would appreciate you"
Do you want to save a file (.bmp)? If so, this question is very very very often shown here on the message board! Try CXImage in the Bitmaps & Palettes section here on CodeProject! ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------
-
I have drawn some lines etc. on a CDC , now can I save this drawing to a Bmp File ?? How ? Thanks in advance ! Abhishek Narula "Learn to appreciate others ... World would appreciate you"
You've actually drawn lines on a bitmap *selected* into a CDC, and has been pointed out, this question is addressed in the FAQ. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
You've actually drawn lines on a bitmap *selected* into a CDC, and has been pointed out, this question is addressed in the FAQ. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
Okay so you mean by GetCurrentBitmap() I ll get the bitmap of what ever is drawn on the screen ... so now how do i save this to a file ?? If you dont mind please give me the URL of FAQ , I am some what new to this Forum ! Regards, Abhishek Narula "Learn to appreciate others ... World would appreciate you"
-
Okay so you mean by GetCurrentBitmap() I ll get the bitmap of what ever is drawn on the screen ... so now how do i save this to a file ?? If you dont mind please give me the URL of FAQ , I am some what new to this Forum ! Regards, Abhishek Narula "Learn to appreciate others ... World would appreciate you"
Here it is :- The Mike and Maunder FAQ http://www.codeproject.com/useritems/cppforumfaq.asp Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
Okay so you mean by GetCurrentBitmap() I ll get the bitmap of what ever is drawn on the screen ... so now how do i save this to a file ?? If you dont mind please give me the URL of FAQ , I am some what new to this Forum ! Regards, Abhishek Narula "Learn to appreciate others ... World would appreciate you"
Abhishek Narula wrote: I am some what new to this Forum In that case, welcome. :-) As you've drawn onto this bitmap yourself, I presume you created the CDC, and selected the bitmap into it. So where is the confusion in getting hold of the bitmap, if you created it ? If you're talking about a screen DC, which MFC passed to you with a bitmap in it, you can use GetCurrentBitmap, or create a new CDC select a new bitmap into it and copy across. As for the URL, cast your eyes upward from my post and just under the banner ad for Visual Assist ( try it if you haven't got it, it rules ), is a row of links. The left most link is to the FAQ. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
Abhishek Narula wrote: I am some what new to this Forum In that case, welcome. :-) As you've drawn onto this bitmap yourself, I presume you created the CDC, and selected the bitmap into it. So where is the confusion in getting hold of the bitmap, if you created it ? If you're talking about a screen DC, which MFC passed to you with a bitmap in it, you can use GetCurrentBitmap, or create a new CDC select a new bitmap into it and copy across. As for the URL, cast your eyes upward from my post and just under the banner ad for Visual Assist ( try it if you haven't got it, it rules ), is a row of links. The left most link is to the FAQ. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
I think you have understood my problem !! I have made some drawing on my CDC , using LineTo etc .. functions .. now I want to save this drwaing as Bitmap file which I can open in MS-Paint. Can I do this ?? rather I am sure we can do this .. but How ? thats the question. Any way thanks a lot for all the pains that you have taken to reply !! Abhishek Narula "Learn to appreciate others ... World would appreciate you"
-
I think you have understood my problem !! I have made some drawing on my CDC , using LineTo etc .. functions .. now I want to save this drwaing as Bitmap file which I can open in MS-Paint. Can I do this ?? rather I am sure we can do this .. but How ? thats the question. Any way thanks a lot for all the pains that you have taken to reply !! Abhishek Narula "Learn to appreciate others ... World would appreciate you"
I am sorry in the first line i meant that you have not understood my problem , a typing mistake ! Abhishek Narula "Learn to appreciate others ... World would appreciate you"
-
Here it is :- The Mike and Maunder FAQ http://www.codeproject.com/useritems/cppforumfaq.asp Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
Thanks Buster !! you have always been a great help ! thanks Abhishek Narula "Learn to appreciate others ... World would appreciate you"
-
I think you have understood my problem !! I have made some drawing on my CDC , using LineTo etc .. functions .. now I want to save this drwaing as Bitmap file which I can open in MS-Paint. Can I do this ?? rather I am sure we can do this .. but How ? thats the question. Any way thanks a lot for all the pains that you have taken to reply !! Abhishek Narula "Learn to appreciate others ... World would appreciate you"
Abhishek Narula wrote: I think you have understood my problem !! I think I have to, but I don't think you've understood my replies... Abhishek Narula wrote: I have made some drawing on my CDC , using LineTo etc .. functions .. now I want to save this drwaing as Bitmap file which I can open in MS-Paint. So.... if you created the CDC, and selected a bitmap into it ( and if you created a CDC and DIDN'T select a bitmap into it, then the CDC contains a 1x1x1 bitmap ), then you already have the CBitmap, if you got the CDC from OnPaint or similar ( it's the background of a dialog box, say ), then you need to either call GetCurrentBitmap or create a new CDC/CBitmap pair to copy this bitmap across. Also, if you're creating the bitmap, creating a DIBSection will allow you to save it at any bit depth, instead of just that of the screen. You can do that with Chris Maunders DIBSection class, which is on CP. Abhishek Narula wrote: Can I do this ?? rather I am sure we can do this .. but How ? thats the question. Both Nish and I have pointed you to the FAQ, he even kindly looked up the URL ( I was too lazy ). The whole point of having a FAQ would be negated if we went off and quoted it to people unwilling to read it, don't you think ? If you've read the FAQ and are still confused, please explain which bit is not making sense to you, and I'll be happy to clarify. You can also look up my GDI+ articles or the CXImage class here on CP, two solutions offered on this site ( some of the solutions in the FAQ are not on CP ). Abhishek Narula wrote: Any way thanks a lot for all the pains that you have taken to reply !! I am always glad to help. If you are stuck after reading the FAQ, don't hesitate to ask again. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now