473,230 Members | 1,580 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,230 software developers and data experts.

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 4703
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 GetThumNailImage 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.GetThumbnailImage(Height, Width, Nothing, inp)
' Else
' Return Nothing
' End If
'Catch er As Exception
' Return Nothing
'End Try
'Convert to Bitmap if desired
'Return CType(MyThumbImage, 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 GetThumNailImage 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.GetThumbnailImage(Height, Width, Nothing, inp)
' Else
' Return Nothing
' End If
'Catch er As Exception
' Return Nothing
'End Try
'Convert to Bitmap if desired
'Return CType(MyThumbImage, 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 GetThumNailImage 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.GetThumbnailImage(Height, Width, Nothing, inp)
' Else
' Return Nothing
' End If
'Catch er As Exception
' Return Nothing
'End Try
'Convert to Bitmap if desired
'Return CType(MyThumbImage, 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
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...
3
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...
1
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...
15
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
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...
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:...
8
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...
3
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...
7
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...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.