473,748 Members | 5,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Showing gaphics

I'm trying to dynamically add a picturebox control to a form.

I'm following some coding I see in the form designer generated code:
....and so far....nothing. Any help is appreciated.
Dim myPicture As New PictureBox()

With myPicture

myPicture = New System.Windows. Forms.PictureBo x()

..Visible = True

..Name = "NewPicture "

..Size = New System.Drawing. Size(64, 48)

'myPicture.Loca tion.X = new System.drawing

..TabStop = False

..Location = New System.Drawing. Point(700, 300)

..Image.FromFil e("c:\temp\holi day1.jpg")

..Show()

End With


Nov 20 '05
22 1415
Maybe you will consider the ideea of direct paint the image on the form
without this struggle of adding picture box only for display

Something like this:

In form's Paint event

dim myImg as new Image.fromFile( ...)
e.Graphics.draw Image(myImg,... .)

--
Ceers,
Crirus

------------------------------
If work were a good thing, the boss would take it all from you

------------------------------

"Andy Chan" <an***********@ telus.net> wrote in message
news:OV******** ******@TK2MSFTN GP11.phx.gbl...
I'm trying to dynamically add a picturebox control to a form.

I'm following some coding I see in the form designer generated code:
...and so far....nothing. Any help is appreciated.
Dim myPicture As New PictureBox()

With myPicture

myPicture = New System.Windows. Forms.PictureBo x()

.Visible = True

.Name = "NewPicture "

.Size = New System.Drawing. Size(64, 48)

'myPicture.Loca tion.X = new System.drawing

.TabStop = False

.Location = New System.Drawing. Point(700, 300)

.Image.FromFile ("c:\temp\holid ay1.jpg")

.Show()

End With

Nov 20 '05 #11
Cor
Hi Fergus,

Good morning

Where did you been, did you sleep a night, very good.

Or was it football with all those London clubs?

:-))

Cor
Nov 20 '05 #12
Cor
Hi Fergus,

With that what Crirus now tells I was strugling yesterday.

In your example for me you use that
e.graphics.draw (master,rectang le,rectangle,si ze)

It was drawing direct on the screen in the place of the second picture box.
You did use the rectangle of that picture box. I found it now, but did cost
some thinking before I saw it was not placed in that picturebox.

(All is ready now I start to get it smaller and saving.
I start just with seeing if the thumbnail will work for me, and if that does
not work for me. I go search and will ask Herfried, Nick, Crirus and you
again, how I can delete some information from the pixel information. (Not
just removing pixels, that gives not nice pictures). But bringing by
instance colours back from 16Kbits to 64bits or what is more not direct
needed information for internet.

Cor

Nov 20 '05 #13
Good morning Cor,

I promised Scorpion that I'd write him a Registry Searcher so I had to
keep the modem unplugged and give myself time for it. (otherwsie - too much
temptation to answer 'just one more question'). And I still have another
couple oif things that need to be done for people. I heaped my plate high -
now I have to eat it!

Football? What's that?? ;-))

Regards
Nov 20 '05 #14
Before unplugg again the modem, will you look at my issue about mouse
cursor.. :D

please!
--
Ceers,
Crirus

------------------------------
If work were a good thing, the boss would take it all from you

------------------------------

"Fergus Cooney" <fi****@post.co m> wrote in message
news:uM******** ******@TK2MSFTN GP09.phx.gbl...
Good morning Cor,

I promised Scorpion that I'd write him a Registry Searcher so I had to
keep the modem unplugged and give myself time for it. (otherwsie - too much temptation to answer 'just one more question'). And I still have another
couple oif things that need to be done for people. I heaped my plate high - now I have to eat it!

Football? What's that?? ;-))

Regards

Nov 20 '05 #15
Hi Cor,

|| All is ready now I start to get it smaller and saving.

Sounds good...I look forward to seeing it.

|| But bringing by instance colours back from 16Kbits to 64bits

You'll be studying these I reckon.
Encoder Class
EncoderParamete r Class
EncoderParamete rs Class
http://support.microsoft.com/?kbid=324788

Regards,
Fergus
Nov 20 '05 #16
Cor
Hi Fergus,

To forfill this I try to do everything in English.
Sounds good...I look forward to seeing it.


Did you know that this is an advantage normaly from non native English
language programmers on native English language programmers.

We use our own language for variables and english for keywords and defined
objects etc. And because a lot of non native English speakers send in code
parts, I'v seen here we normaly do that all.

By doing this we have never a problem to get mixed up. But now I did take
the chalenge to do it in English, so I can show you the results and I am
developing it still as a stand alone program.

Cor
Nov 20 '05 #17
Hi Cor,

|| We use our own language for variables and english for
|| keywords and defined objects etc
|| By doing this we have never a problem to get mixed up.

It's a nice advantage - much clearer separation of App from System. Also,
you get your own choice. Many's the time I'd like to use a word that has
already been taken.

But for sticking to English - thanks! ;-)

Regards,
Fergus
Nov 20 '05 #18
Hi Fergus,

Thanks for the input.

Wow. I've been doing VB 6 for sometime now. I've been behind the times and
finally sitting down to do some .NET coding. Boy, what a difference. It's
like I have to start all over again.


"Fergus Cooney" <fi****@post.co m> wrote in message
news:uY******** *****@TK2MSFTNG P11.phx.gbl...
Hi Andy,

You're right to use the code that the Form Designer creates but you have to do it carefully (like Crirus's Controls.Add) - and know which bits to do differently - like Image.

The Designer uses embedded resources which is not what you want. You
spotted that so you used

myPicture.Image .FromFile("c:\t emp\holiday1.jp g")

Unfortunately this loads an image and then throws it away because it's not being assigned to anything. The use of myPicture doesn't mean that it updates myPicture!

The bit that you're missing is <setting> the Image.

myPicture.Image = Image.FromFile ("c:\temp\holid ay1.jpg")

Regards,
Fergus

Nov 20 '05 #19
SUCCESS!!!

Thanks to everyone who contributed! Hope to return the favor someday.....but
umm.....I think I've got a bit of a learning curve before I do so.

It seemed to come down to 2 things I was doing wrong:

1. mypicture.Image = Image.FromFile( "c:\temp\holida y1.jpg") was definitely
it.

and

2. I was adding the the control with me.controls.add after I was trying to
set the picture. Once I moved this before the picture creation, no problem.


"Andy Chan" <an***********@ telus.net> wrote in message
news:OV******** ******@TK2MSFTN GP11.phx.gbl...
I'm trying to dynamically add a picturebox control to a form.

I'm following some coding I see in the form designer generated code:
...and so far....nothing. Any help is appreciated.
Dim myPicture As New PictureBox()

..Image = Image.FromFile( "c:\blackjack\c lubs3.jpg")

With myPicture
myPicture = New System.Windows. Forms.PictureBo x()

.Visible = True

.Name = "NewPicture "

.Size = New System.Drawing. Size(64, 48)

'myPicture.Loca tion.X = new System.drawing

.TabStop = False

.Location = New System.Drawing. Point(700, 300)

.Image.FromFile ("c:\temp\holid ay1.jpg")

.Show()

End With

Nov 20 '05 #20

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

Similar topics

4
7328
by: Vishnu | last post by:
I have a strange problem on WindowsXP proffessional with IE6 ,when i try to display a tiff file ,it is not showing ,small red x is comming up. I tried by dowloading latest IE from microsoft but no use. This is working fine on win2k IE6 Here is the html file I am using to display the tif file <html> <head>
2
2224
by: c.anandkumar | last post by:
Hi All - I have some problems getting a small piece of javascript working correctly for Firefox. Here is what I am trying to do - 1. I have a form (like a search form) 2. I have many groups of searchable fields in the fields 3. Each group can be expanded/collapsed by clicking on a link "(Fewer|More) Options" which sits right next to the group title.
3
3081
by: Brian Henry | last post by:
Is there anyway to prevent the white box that drops down when you do a combobox dropdown from showing? I am trying to make a custom combobox which requires showing a custom form in its place, but the white box shows up still ontop of the new form that is taking its palce even though there is no items in the white box. Any windows messages or anything you can trap or whatnot? thanks!
1
840
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems controlling the visibility of columns in the DataGrid control. The problem usually comes down to one fact. The DataGrid has a property called AutoGenerateColumns. The default value is "True". This means that when AutoGenerateColumns is set to True,...
0
1241
by: ikhan | last post by:
Hello, I am using an activex control on my website. It was running fine with framework 1.1, when I try to run it on framework 2.0 it's not showing up. It's not showing any error message, just a "image not found icon" in webpage's body and "DONE" on IE's status bar. When switch it to framwork 1.1 it runs fine. What I think for the activeX not showing issue is that this might be some security issue because I had the same problem earlier...
10
2157
by: bessington | last post by:
hey all, i'm having a rather bizarre problem.. the image tag i have declared in my xhtml is not showing in safari / konqueror but showing just fine in Firefox, IE, Opera... this is a complete mystery and I have been scouring every book / resource I can find but haven't come up with an answer. any one have any ideas? all other images in site showing fine - but they are declared as background images in the css. the site is:...
15
2696
missinglinq
by: missinglinq | last post by:
I'd like to use acCmdAppMinimize with two forms on the screen at once. Currently, if I have a form opening the db (with DoCmd.Maximize in the OnLoad event) and then a popup form on top of the first form, the first form vanishes when the second form appears. Alternatively, I like to have both showing with just the Access container showing, with no native menus showing. Unchecking everything in Startup gets rid of everythinh except File - Edit...
3
3366
by: Torben Laursen | last post by:
I have a COM shared add-in written in C# that I use in Excel. One of the thinks that the user can do is to open some winforms. The problem that I have is that the first time the user opens a winform it is slow around 7 seconds and after that it takes no time. Is there a way to speed up the process to show the winform the first time? Thanks Torben
6
2777
by: ajk | last post by:
Hi I was wondering how to show different properties in design and run-mode for a user control? Is it possible to do this when implementing the System.ComponentModel.ICustomTypeDescriptor interface? e.g. when selecting the control from a toolbox with controls other properties show up when the program is in design mode than in run mode.
6
4186
by: painkiller | last post by:
language: vb.net environment: windows forms .net : v1.1 i am having a checkedlistbox control that display document category such as text, image, video, audio etc. these values are coming from database. when a user clicks any of the above values and saves the form, the item's "value" is getting saved in database. and when a user logs back in, his/her previously checked value items should be shown as checked. Everything is working fine...
0
8826
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
9366
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
9241
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
8239
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
6793
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
4597
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...
1
3303
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
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
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.