Difference between picture box and image
Difference between picture box and image
Difference between picture box and image
Difference between picture box and image
Difference between picture box and image
Difference between picture box and image Difference between picture box and image Difference between picture box and image Difference between picture box and image Difference between picture box and image Difference between picture box and image Difference between picture box and image Difference between picture box and image
Difference between picture box and image Difference between picture box and image
Difference between picture box and image
Go Back  Xtreme Visual Basic Talk > > > Difference between picture box and image


Reply
 
Thread Tools Display Modes
  #1  
Old 12-14-2005, 11:15 PM
shar shar is offline
Centurion
 
Join Date: Dec 2005
Posts: 194
Default Difference between picture box and image


What are the differences between picture box and image? In which situations can I use them?
Reply With Quote
  #2  
Old 12-14-2005, 11:43 PM
guest_5432Difference between picture box and image guest_5432 is offline
Junior Contributor

* Expert *
 
Join Date: Nov 2005
Posts: 259
Default Picturebox (picBox) control vs image control

Quote:
Originally Posted by shar
What are the differences between picture box and image? In which situations can I use them?
Let me count the ways...

Main Difference:
The Image control is a lightweight control that has no device context (or hDC) or it's own. The Picturebox does have a device context and hDC and is a true "window" from the point of view of the Windows operating system (and can directly use "hWnd" parameter API calls).
Due to this difference, an Image control can display a gif file loaded into the picture property with a transparent background, while a picturebox does not. The Picturebox, however, doesn't "flicker" when moved at runtime like an Image control does. This difference also has implications for layering -- a lighweight control (like the Image control) can only be z-ordered (layered) over another lighweight control --but never over a true window like the Picturebox control. The Image control is also "lightweight" in terms of it's memory footprint (versus the Picturebox control which is "heavier" even without the extra memory backbuffer that is reserved with its AutoRedraw property set to True) --although with the amount of memory available in most modern computers, this doesn't usually make this much of a difference, but it might come into play with large control arrays containing large graphics that would force paging out to virtual memory (which, in turn, could effect the speed of game graphics).

An Image control has Stretch property, a Picturebox control does not.
Picturebox control has an AutoSize property, an Image control does not.
However code workarounds can substitute for these two missing properties in either/both.

Both controls use a StdPicture object to store graphics and so Picture.Render and LoadPicture/SavePicture will work with both (but PaintPicture only works with the Picturebox control).

A Picturebox control is a container control, an Image control is not.
A Picturebox control also has a whole bunch of properties that an Image Control does not - BackColor, FillColor, FillStyle, etc.

The long and short of it [IMHO] is that the PictureBox control is the more generally useful of the two controls and used in conjunction with PaintPicture or the Bitblt/Stretchblt/AlphaBlend APIs can do just about anything you could want with graphics.

DirectX surfaces may be slight faster way of manipulating graphics, but when using Direct Memory Access (DMA) pixel manipulation techniques with Picturebox control graphics --it can be relatively quick..and works even with older non-Directx compatible video cards/systems.

Last edited by guest_5432; 12-15-2005 at 12:28 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Difference between picture box and image
Difference between picture box and image
Difference between picture box and image Difference between picture box and image
Difference between picture box and image
Difference between picture box and image
Difference between picture box and image Difference between picture box and image Difference between picture box and image Difference between picture box and image Difference between picture box and image Difference between picture box and image Difference between picture box and image
Difference between picture box and image
Difference between picture box and image
 
Difference between picture box and image
Difference between picture box and image
 
-->