473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to create the thumbnail view from the form?

How can I create the Thumbnail view from the form?
In the following approach I tried but Iams facing some limitations to get
the thumbnail image of the form alone.

Plaese any one can help in this regard. It is a serious problem for me.
Thanks!

Approach - I - Bitmap (screen capture method)
=============================================
Can able to create the thumbnail image using Bitmap and BitBlt.

Code Sample:
Graphics g1 = this.CreateGraphics();
Image MyImage = new
Bitmap(this.ClientRectangle.Width,this.ClientRecta ngle.Height, g1);
Graphics g2 = Graphics.FromImage(MyImage);
IntPtr dc1 = g1.GetHdc();
IntPtr dc2 = g2.GetHdc();
BitBlt(dc2, 0, 0, this.ClientRectangle.Width,
this.ClientRectangle.Height, dc1, 0, 0, 13369376);
g1.ReleaseHdc(dc1);
g2.ReleaseHdc(dc2);
MyImage.Save(@"c:\BaluCaptured.jpg", ImageFormat.Jpeg);
MessageBox.Show("Finished Saving Image");

Limitations Facing:

1) Not able to capture the non visible portion of the form.
2) If the specified region size is beyond the visible portion in the
screen, then remaining portions are in black color.
Approach - II - Metafile

Can able create the image using Metafile approach. How can we create the
metafile for user controls drawn objects (Example: Graphs, Gauges).
Graphics grph = this.CreateGraphics();
IntPtr ipHDC = grph.GetHdc();
Metafile mf = new Metafile(@"d:\TestBalu.emf", ipHDC, EmfType.EmfPlusDual);
//grph.ReleaseHdc(ipHDC);
//grph.Dispose();
grph = Graphics.FromImage(mf);
grph.DrawRectangle(Pens.Blue, 10, 10, 100, 120);
Point p1 =new Point(20,60);
Point p2 =new Point(40,80);
Point p3 =new Point(100,120);
Point p4 =new Point(120,260);
Rectangle re=new Rectangle(30,20,60,90);

grph.DrawBezier(Pens.Gold, p1,p4,p3,p2);
grph.DrawBezier(Pens.Gold, p2,p4,p3,p2);
grph.Dispose();
Limitations Facing:

1) This can be possible for regular Graphics objects like creating
Rectangle, Ellipse... using System.Drawing class.
2) It is not supporting for 3rd Party controls like Dundas gauge controls.
When we try to create the metafile (emf) the file size shows 0KB. It is
not writing the data in to the file.
Approach – III – Scale down the Form
How to clone the form which contains the graphics objects like rectangle,
user controls?
When we are trying to clone, it is only referring the memory; it is not
actually cloning the object.

Code Sample:
Form2 obj = new Form2();
obj.Width = 640;
obj.Height = 480;
obj.BackColor = Color.Green;
obj.Show();

Form obj1 = new Form2();
obj1 = obj;
obj1.MaximizeBox = false;
obj1.MinimizeBox = false;
obj1.ControlBox = false;
obj1.FormBorderStyle = FormBorderStyle.None;
obj1.Scale(0.2f, 0.2f);
obj1.Show();

Limitations Facing:
In .net we don’t have direct clone method to clone the form object. How can
we clone the form object?

Nov 16 '05 #1
0 2265

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: PWalker | last post by:
Hi, I have several webpages that have around 50+ thumbnail images in it in a table structure spanning (3 columns) x (17+ rows). Each thumbnail is wrapped in the following piece of javascript: ...
1
by: Kanaiya | last post by:
hello i want to show thumbnail image view control which display captured images on this control but in small size. it is possible to add any no. of images in that control. and aslo possible to add...
2
by: Mark R. Dawson | last post by:
Hi all, I have a directory full of images (most over 2MB in size) I was to show each image as a thumbnail on a form, however in order to create a thumbnail I have to open the complete image then...
6
by: Rich | last post by:
Hello, I want to simulate the dynamic thumbnail display of Windows Explorer (winxp) on a form or pannel container. If I place a picture box on my container form/pannel and dimension it to the...
8
by: barb | last post by:
So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1:...
1
by: Marjosdiri | last post by:
Hello, I am new here and searched this afternoon for the problem of imaging, size and thumbnails in MS Access. Unfortunately, I couldn't find any similar case! So, I was wondering if anyone can help...
1
by: Duracel | last post by:
Hi (this is a rephrase of my question from yesterday!), How can I set the size of the thumbnails of a listview in thumbnail mode? I'm owner drawing images from my own cache (i.e. they aren't...
8
by: Arno R | last post by:
Hi all. When I need to search for pictures, I always have too choose thumbnail-view manually. Is it possible to open the common dialog in thumbnail-view programmatically? Example ?? At the...
2
by: djpaul | last post by:
Hello, I have this program and when i want to load pictures it crashes at the form.showdialog()....??? Here it goes: Private Sub CmbPath_SelectedIndexChanged(ByVal sender As Object, ByVal e As...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.