मैं छवि सहेजे गए छोटे आकार में रखना चाहता हूं। मैं इसका आकार कैसे बदल सकता हूं? मैं छवि redering के लिए इस कोड का उपयोग:बिटमैप छवि का आकार बदलें
Size size = new Size(surface.Width, surface.Height);
surface.Measure(size);
surface.Arrange(new Rect(size));
// Create a render bitmap and push the surface to it
RenderTargetBitmap renderBitmap =
new RenderTargetBitmap(
(int)size.Width,
(int)size.Height, 96d, 96d,
PixelFormats.Default);
renderBitmap.Render(surface);
BmpBitmapEncoder encoder = new BmpBitmapEncoder();
// push the rendered bitmap to it
encoder.Frames.Add(BitmapFrame.Create(renderBitmap));
// save the data to the stream
encoder.Save(outStream);
यह कोशिश-पकड़ ब्लॉक के बिना बिल्कुल सही है। –
आकार का हिस्सा महत्वपूर्ण है, मुझे 2 इंट्स का उपयोग करके कई पुराने उत्तर मिलते हैं लेकिन आपको अब आकार की आवश्यकता है। उस पर ध्यान देने के लिए धन्यवाद, कुछ परेशानी बचाई। (भविष्य में दर्शकों के लिए 2 इंट्स का उपयोग करके जवाब जानने के लिए टिप्पणी करने के लिए टिप्पणी करना) –