Originally posted by: bjevtic
How Bitmap or Image can be resized (scaled)?
Task is:
1. Construct Bitmap from file.
2. Scale (resize) it (make 2 times smaller, for example)
3. Save it.
No GUI operations wanted.
Reply
Originally posted by: John Nagle
I had not yet heard of GDI+...I downloaded it and was experimenting with it (gleefully) in just about 20 minutes. I hope that others reading this realize just how significant an improvement over GDI this really is. As someone who has fought with GDI for many years now, this is a very welcome step up. Contrary to what others are saying, I've found the documentation on the MSDN site to be quite extensive and abundantly helpful. The page is bookmarked in my browser and I just keep it open while I'm working on my project. Thanks again! -John
ReplyOriginally posted by: Kent Haraburda
I have been trying to get the tiff compression working. Here is the code I have been using. It saves the image, but it is not compressed.
encoderParameters.Count = 1;
encoderParameters.Parameter[0].Guid = EncoderCompression;
encoderParameters.Parameter[0].Type = EncoderParameterValueTypeLong;
encoderParameters.Parameter[0].NumberOfValues = 1;
ULONG compression = EncoderValueCompressionLZW;
encoderParameters.Parameter[0].Value = &compression
stat = image->Save(L"Shapes001.tif", &encoderClsid, &encoderParameters);
Is there something I am missing or is compression not supported?
Kent
ReplyOriginally posted by: Tobias Althammer
Bitmap *bitmap;
If so, please tell me how you've done this. Cause GDI+ seems to override the new
Has anybody sucessfully tried to allocate a GDI+ class like documented in the MSDN:
bitmap=new Bitmap(L"c:\\test.png");
command and I don't know how to handle it. My compiler always quits with the
error C2660: function doesn't accept 3 parameters ???!!!
Originally posted by: Adam Phillips
First thanks to both Max and Leandro Gustavo Biss Becker for your responses to my earlier post, GDI+ correction. They were both very helpful!
I am trying to use GDI+ to read an EMF file, apply a number of transformations, and then either write it back to to disk as an EMF file or rasterize it.
I can open my EMF file. I have set up the metaCallback function. I am calling EnumerateMetafile and it does call the callback.
My problem is that I seem unable to create a Metafile that accecpts writing. I am trying:
char tempy[MAX_PATH];
strcpy (tempy, TEXT("DISPLAY"));
HDC hDC = CreateDC (tempy, NULL, NULL, NULL);
Metafile OutImage (L"C:\\test2.emf", hDC);
//***//callback fn
metafile->PlayRecord(recordType, flags, dataSize, pStr);
//**// end callback fn
The above PlayRecord function fails giving the error "Invalid parameter"
Any ideas? Is this the wrong hDC to use?
Originally posted by: Serg
Than change function GDI SetPixel
Thank you
ReplyOriginally posted by: John
I sure havent and dont have a clue how to use it. As usual, despite the fact that there is some info on the MSDN site, the info is sketchy, confusing and probably inacurate. I'd do cartwheels if i could just get a bmp to load with GDI+.
Reply
Originally posted by: Carlos Garcia
I can't find a substitute for SetROP2.
I want to draw in inverted color but I don't know how to.
With GDI I can use SetROP2 function to set how colors are
combined with the background, but I don't see something like that in GDI+.
Anyone can help me?
ReplyOriginally posted by: Dong
download should be athttp://www.microsoft.com/downloads/release.asp?ReleaseID=32738
ReplyOriginally posted by: Glenn Wilson
Hi. I've downloaded all of the files, and tried the demos to no avail. I've seen other posts claiming to have errors with 'undeclared identifiers' and this is the problem I'm facing. I've read all of the samples on the MSDN library (October, 2001) and I guess I'm just being code dumb. Can somebody post a working project so I can see the relationship to all of this?
Also, do I need to do anything else with the files from the gdi header/lib downloads other than place the inlude files in INCLUDE and the .lib file in LIB?
Thanks!
My email address has been modified to stop junk mail.
Reply