473,703 Members | 2,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.CreateGrap hics();
Image MyImage = new
Bitmap(this.Cli entRectangle.Wi dth,this.Client Rectangle.Heigh t, g1);
Graphics g2 = Graphics.FromIm age(MyImage);
IntPtr dc1 = g1.GetHdc();
IntPtr dc2 = g2.GetHdc();
BitBlt(dc2, 0, 0, this.ClientRect angle.Width,
this.ClientRect angle.Height, dc1, 0, 0, 13369376);
g1.ReleaseHdc(d c1);
g2.ReleaseHdc(d c2);
MyImage.Save(@" c:\BaluCaptured .jpg", ImageFormat.Jpe g);
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.CreateGrap hics();
IntPtr ipHDC = grph.GetHdc();
Metafile mf = new Metafile(@"d:\T estBalu.emf", ipHDC, EmfType.EmfPlus Dual);
//grph.ReleaseHdc (ipHDC);
//grph.Dispose();
grph = Graphics.FromIm age(mf);
grph.DrawRectan gle(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.MaximizeBo x = false;
obj1.MinimizeBo x = false;
obj1.ControlBox = false;
obj1.FormBorder Style = 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 2290

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

Similar topics

1
1619
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: <a href="#" onClick="javascript:window.open('Images/image_name.jpg','window','width=430,height=560,resizable=yes')"> Now since there are so many thumbnails, the page needs to be scrolled to view the thumbnails at the bottom of the list. When i...
1
2886
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 event on it. -- With regards, Gangani Kanaiya.
2
4582
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 scale it down. This is quite slow, since there is a lot of file IO going on, what I want to be able to do is open the image in the scaled down size so that I miss out the step of opening the file then dowsizing it. I have not been able to find...
6
4752
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 size of a thumbnail and set the sizemode to Stretch -- I get one thumbnail. I want to retrieve all the picture files (jpg, bmp) in a directory into an array list and then display this list as thumbnails on my form dynamically. So my question is...
8
20363
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: Start with original thumbnails & two empty sub directories STEP 2: Create smaller versions of the originals for one sub directory STEP 3: Create thumbnail version of the originals the other sub directory STEP 4: Create an index.html pointing to the...
1
2032
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 me with the following: I have a MS Access database with covers of all our library books (in total 1900 records), so that we can see how the cover of the books looks like. Because we linked all our covers one by one with Object instrument, our...
1
2123
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 stored in LargeImageList) but the only way I can see to tell the listview how large I want each thumb to be is by setting the ImageSize property of LargeImageList. Unfortunately, the maximum size for an image in this case is 256 x 256 pixels, but...
8
4695
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 moment I am using Ken Getz' code. at http://www.mvps.org/access/api/api0001.htm Thanks Arno R
2
1547
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 System.EventArgs) Handles CmbPath.SelectedIndexChanged Dim Table As DataTable Dim i As Integer Dim ThumbSize As Integer = 160
0
8669
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8963
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7872
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5922
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4433
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2453
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2069
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.