I have tried your code but has an error accessing Image.bmp. Another thing is that I will not copy from a bitmap file to another bitmap file. Instead, I have already a binary data in an array to copy to a bitmap file. Hope you can help me with this. Thanks.
TooShy2Talk
Posts
-
How to write Binary data to a file???? [modified] -
How to write Binary data to a file???? [modified]Thanks for the comment. Well I have tried using CStdioFile and had successfuly created a file but the file cannot be opened to any image viewer. Error message implied of the wrong header. // my code here CStdioFile fp; CFileException e; if(fp.Open("c:\\Image.bmp",CFile::modeCreate|CFile::modeWrite|CFile::typeBinary,&e)) fp.Write(&buf,100000); // end * file was created and not 0 byte. Did I use it wright? or There's something wrong with my code?
-
How to write Binary data to a file???? [modified]Hello guys, Hope you can help me with this one. For example, BYTE buf[100000]; // contains binary data of an image I wanted it to be written in an image file(*.bmp). Thanks in advance.
modified on Wednesday, April 22, 2009 10:28 PM
-
How to save HDC to a file?Hi, I wanted to save HDC into a file(*.jpg). How can I do this? I will appreciate your reply. Thanks.
-
How to convert HDC to CBitmap?Hello guys, I wanted to convert an HDC to a CBitmap object but I don't know how to. How can I possibly manipulate HDC and probably create a CBitmap from it. Hope you can help me with this one. It will be a big help. Thanks.
-
GDI+ concern???????Finally, it WORKS. Thank you very much. It's a big help. Till my next question. :laugh: :laugh:
-
GDI+ concern???????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".
-
GDI+ concern???????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.
-
GDI+ concern???????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?
-
GDI+ concern???????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. -
GDI+ concern???????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. -
GDI+ concern???????SandipG :) wrote: Why dont you create a stitched bitmap first and then draw this bitmap on device context. i mean Graphics gr(bmpTemp) .... Stitching code. Graphics gr(hDC) RatateTransform()... DrawImage(bmpTemp).. Does it make sense?? Regards, Sandip.
I received a reply from Sandip but I'm having hard time translating it to code. The process is what i needed it's just that I can't make it work. First I haven't found a constructor for Graphics gr(bmpTemp) and for function DrawImage(bmpTemp).. I'm not that good in GDI so I hope somebody can help me. It will be a big help if you reply. Thanks. -
About Graphics::RotateTransform()????Thanks for the reply. I look at MSDN and I haven't found a constructor for bitmap. Is there any?
-
About Graphics::RotateTransform()????Thanks for the reply. Placing DrawImage after RotateTransform somewhat rotate my image tiles before stitching them. What I wanted is to stitch all first then rotate. Is there any other way to do this.
-
About Graphics::RotateTransform()????Hi, Is it possible to use RotateTransform() after Graphics::DrawImage()? Ex. Graphics g(hMemDC); for(){ for(){ ..... g.DrawImage(); } } g.RotateTransform(); Based from MSDN example RotateTransform is before DrawImage() function but I have tried the above code (6 months ago) and it works. But now this code doesn't work anymore. Image doesn't rotating anymore. My code is for stitching tiles of an image to make it whole. When I place RotateTransform() before DrawImage() it produces black dash lines in between tiles. It's been a solution to place RotateTrasform after DrawImage but now I can't make it work. What seems to be the problem? Do I have to add some more code? Hope somebody can help me. Thanks.
-
Limit for vector?????Hi guyz, I just want to know if there's a limit on vector size. What is the maximum vector size? I'm using a vector of CString and store about 100K+ absolute path and experience program hang. Am I reaching the vector's limit? Hope you can help me thanks.
-
How to capture "[" and "]" keys on OnKeyDown()?Thanks for the reply. It's a big help
-
How to capture "[" and "]" keys on OnKeyDown()?Hi, Hope somebody can help me with this one. I want to capture pressing "[" and "]" on OnKeyDown() event. For controls like shift if(VK_SHIFT) For capturing letters, I use example pressing s. if(nChar=="s") but for other keys like "[", "]" and numerics it's not applicable. How can i capture other keys?
-
Problem using OnKeyDown in CDialog ????Ok, Thanks a lot. I'll try this.
-
Problem using OnKeyDown in CDialog ????Hamid. wrote:
Do you have any controls on the dialog?
Yes, CButtons and CEdit controls.