473,748 Members | 3,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

create dynamic thumbnails on form or pannel using a picturebox?

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 "how do I create
thumbnails on the fly"? I am thinking - copy the picturebox at runtime as
many times as I need. Am I on the right track here? Or is there a more
efficient/correct way to do this? If I have to copy the picturebox at
runtime - how is this accomplished?

Thanks,
Rich
Nov 21 '05 #1
6 4757
Would a datagrid be an option? I could create the datagrid on the fly and
have an image column(s). Any suggestions appreciated.

"Rich" wrote:
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 "how do I create
thumbnails on the fly"? I am thinking - copy the picturebox at runtime as
many times as I need. Am I on the right track here? Or is there a more
efficient/correct way to do this? If I have to copy the picturebox at
runtime - how is this accomplished?

Thanks,
Rich

Nov 21 '05 #2
Not sure I understand exactly your question but you can create a thumbnail
image from an image using the GetThumNailImag e method for Images;

'Assume MyImage is your image (bitmap, etc)
'Dim inp As New IntPtr
'Try
' If Height > 0 AndAlso Width > 0 Then
' MyThumbImage = myImage.GetThum bnailImage(Heig ht, Width, Nothing, inp)
' Else
' Return Nothing
' End If
'Catch er As Exception
' Return Nothing
'End Try
'Convert to Bitmap if desired
'Return CType(MyThumbIm age, Bitmap)
--
Dennis in Houston
"Rich" wrote:
Would a datagrid be an option? I could create the datagrid on the fly and
have an image column(s). Any suggestions appreciated.

"Rich" wrote:
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 "how do I create
thumbnails on the fly"? I am thinking - copy the picturebox at runtime as
many times as I need. Am I on the right track here? Or is there a more
efficient/correct way to do this? If I have to copy the picturebox at
runtime - how is this accomplished?

Thanks,
Rich

Nov 21 '05 #3
Thanks for your reply. Yes, I did find a sample of the code you show for
creating a thumbnail in a picturebox control. What I want to do is to
display multiple thumbnails in a container like a form or pannel - similar to
Windows Explorer when you select View Thumbnails for a list of jpg or bmp
files in a directory. Is it possible to dynamically create multiple picture
boxes on a form/pannel at run time? How is this accomplished? For example,
I retrieve a list of jpg/bmp files from a directory into an arraylist. Say
there are 5 picture files. I want to display all 5 pictures as thumbnails on
my container. Then say I retrieve a list of picture files from another
directory - say 20 pictures. I want to display those 20 pictures as
thumbnails on my form/pannel.

Thanks,
Rich

"Dennis" wrote:
Not sure I understand exactly your question but you can create a thumbnail
image from an image using the GetThumNailImag e method for Images;

'Assume MyImage is your image (bitmap, etc)
'Dim inp As New IntPtr
'Try
' If Height > 0 AndAlso Width > 0 Then
' MyThumbImage = myImage.GetThum bnailImage(Heig ht, Width, Nothing, inp)
' Else
' Return Nothing
' End If
'Catch er As Exception
' Return Nothing
'End Try
'Convert to Bitmap if desired
'Return CType(MyThumbIm age, Bitmap)
--
Dennis in Houston
"Rich" wrote:
Would a datagrid be an option? I could create the datagrid on the fly and
have an image column(s). Any suggestions appreciated.

"Rich" wrote:
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 "how do I create
thumbnails on the fly"? I am thinking - copy the picturebox at runtime as
many times as I need. Am I on the right track here? Or is there a more
efficient/correct way to do this? If I have to copy the picturebox at
runtime - how is this accomplished?

Thanks,
Rich

Nov 21 '05 #4
Rich wrote:
Thanks for your reply. Yes, I did find a sample of the code you show for
creating a thumbnail in a picturebox control. What I want to do is to
display multiple thumbnails in a container like a form or pannel - similar to
Windows Explorer when you select View Thumbnails for a list of jpg or bmp
files in a directory. Is it possible to dynamically create multiple picture
boxes on a form/pannel at run time? How is this accomplished? For example,
I retrieve a list of jpg/bmp files from a directory into an arraylist. Say
there are 5 picture files. I want to display all 5 pictures as thumbnails on
my container. Then say I retrieve a list of picture files from another
directory - say 20 pictures. I want to display those 20 pictures as
thumbnails on my form/pannel.

Thanks,
Rich


This link might be helpful to you http://tinyurl.com/cfds2.
Nov 21 '05 #5
Thanks. That was a useful example. I will have to study it for a while to
see if I can incorporate (figure out how the controls are created) it into my
app.

Thanks again,
Rich

"Mark" wrote:
Rich wrote:
Thanks for your reply. Yes, I did find a sample of the code you show for
creating a thumbnail in a picturebox control. What I want to do is to
display multiple thumbnails in a container like a form or pannel - similar to
Windows Explorer when you select View Thumbnails for a list of jpg or bmp
files in a directory. Is it possible to dynamically create multiple picture
boxes on a form/pannel at run time? How is this accomplished? For example,
I retrieve a list of jpg/bmp files from a directory into an arraylist. Say
there are 5 picture files. I want to display all 5 pictures as thumbnails on
my container. Then say I retrieve a list of picture files from another
directory - say 20 pictures. I want to display those 20 pictures as
thumbnails on my form/pannel.

Thanks,
Rich


This link might be helpful to you http://tinyurl.com/cfds2.

Nov 21 '05 #6
You can either create the picture boxes on your form at design time then set
the visible property to True for the ones you want to show or you can create
and dispose of them at designtime; To create a picture box at run time;

dim pic1 as new PIctureBox
Me.Controls.Add (pic1)
pic1.Width = xxx
pic1.Height = xxx
pic1.Top=xxx
pic1.Left = yyy
--
Dennis in Houston
"Rich" wrote:
Thanks for your reply. Yes, I did find a sample of the code you show for
creating a thumbnail in a picturebox control. What I want to do is to
display multiple thumbnails in a container like a form or pannel - similar to
Windows Explorer when you select View Thumbnails for a list of jpg or bmp
files in a directory. Is it possible to dynamically create multiple picture
boxes on a form/pannel at run time? How is this accomplished? For example,
I retrieve a list of jpg/bmp files from a directory into an arraylist. Say
there are 5 picture files. I want to display all 5 pictures as thumbnails on
my container. Then say I retrieve a list of picture files from another
directory - say 20 pictures. I want to display those 20 pictures as
thumbnails on my form/pannel.

Thanks,
Rich

"Dennis" wrote:
Not sure I understand exactly your question but you can create a thumbnail
image from an image using the GetThumNailImag e method for Images;

'Assume MyImage is your image (bitmap, etc)
'Dim inp As New IntPtr
'Try
' If Height > 0 AndAlso Width > 0 Then
' MyThumbImage = myImage.GetThum bnailImage(Heig ht, Width, Nothing, inp)
' Else
' Return Nothing
' End If
'Catch er As Exception
' Return Nothing
'End Try
'Convert to Bitmap if desired
'Return CType(MyThumbIm age, Bitmap)
--
Dennis in Houston
"Rich" wrote:
Would a datagrid be an option? I could create the datagrid on the fly and
have an image column(s). Any suggestions appreciated.

"Rich" wrote:

> 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 "how do I create
> thumbnails on the fly"? I am thinking - copy the picturebox at runtime as
> many times as I need. Am I on the right track here? Or is there a more
> efficient/correct way to do this? If I have to copy the picturebox at
> runtime - how is this accomplished?
>
> Thanks,
> Rich

Nov 21 '05 #7

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

Similar topics

1
2460
by: Scott M | last post by:
Hi, I am writing a small game that is using a form 800 * 600. The form can be scrolled vertically up to a height of 1200 (basically the form can be scrolled down one screen vertically). The user controls a picturebox (my sprite) with the cursor keys When the sprite hits the y value of 600 the screen scrolls down to display the bottom part of the screen (by focusing on a hidden
3
5292
by: Bob Bedford | last post by:
I've 2 directories: one contains thumbnails, the other the images. How to create a dynamic photogallery, as manually it's: <div align="center"> <a href="../images/photogallery/images/AIRGLA10.JPG" onClick="return enlarge('../images/photogallery/images/AIRGLA10.JPG',event)"> <img src="../images/photogallery/thumbnails/AIRGLA10.jpg" alt="AIRGLA10" align="bottom" border="1" width="97" height="150"><br> <br><br><br>
1
1285
by: Grosch | last post by:
This is in C# I have controls embeeded in a pannel. Every thing looks ok when displayed in the IDE and on the web page. Two times now after things where layed out and ok. the controls phantom streach. When you look at the properties the sizes are correct. But when you click on the control in the designer it shows a much larger value and causes the design view to streach and be distorted. The page still displays correctly when executed.
15
26513
by: Amit D.Shinde | last post by:
I am adding a new picturebox control at runtime on the form How can i create click event handler for this control Amit Shinde
4
9232
by: Charles | last post by:
Hello Everyone, I have been gettting great feedback from microsoft.public.vc.language group but after doing more searching I think my post should be directed to this group. I am trying to make a simple gif animation using VC++ and 13 different gif files and a timer. I am new to VC++ but played around with C++ for a few years. I am using Microsoft Visual Studio 2005 (VC++).
8
20368
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...
8
3586
by: Ryan | last post by:
Ok.. I have a form with lots of stuff on it; a tool strip panel, menu strip, data binding elements (dataset, binding source, table adapter), tab control with 7 tab pages, each page contains a picture box, lots of text boxes (for input).. you get the idea. All of a sudden everything on the form has disappeared, it looks like a blank, newly created form. I can still get to the properties of every item on the form using the drop-down box in...
3
1778
by: TheLostLeaf | last post by:
How do I change this : this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox3 = new System.Windows.Forms.PictureBox(); this.pictureBox4 = new System.Windows.Forms.PictureBox(); this.pictureBox5 = new System.Windows.Forms.PictureBox(); To This:
7
4403
by: metaphysics | last post by:
For a portfolio I am trying to make, I would like to be able to have a couple thumbnails on the page, that, when clicked, cause a box to horizontally slide in above the thumbnails. I am looking to achieve an effect similar to the one found here: Programming Articles - PHP Scripts, Articles, Tutorials - roScripts, with some minor changes. Instead of arrows to scroll to the next content, I would like thumbnails to trigger the change in...
0
9541
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9370
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...
0
9247
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
8242
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, and deployment—without 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...
1
6796
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3312
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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.