Simple when you know
Simple when you know
Simple when you know
Simple when you know
Simple when you know
Simple when you know Simple when you know Simple when you know Simple when you know Simple when you know Simple when you know Simple when you know Simple when you know
Simple when you know Simple when you know
Simple when you know
Go Back  Xtreme Visual Basic Talk > > > Simple when you know


Reply
 
Thread Tools Display Modes
  #1  
Old 06-29-2006, 04:56 PM
Jamesanthony's Avatar
Jamesanthony Jamesanthony is offline
Contributor
 
Join Date: May 2003
Location: Dublin
Posts: 502
Default Simple when you know


I don't seem to have an image control only picturebox
Is there one in .NET ???
Reply With Quote
  #2  
Old 06-29-2006, 05:03 PM
MikeJ's Avatar
MikeJSimple when you know MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,747
Default

Image controls were made obsolete with .NET and GDI+. Use the Picturebox. (Actually, you really don't even need that if you create your images in memory!)
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
  #3  
Old 06-29-2006, 05:14 PM
Jamesanthony's Avatar
Jamesanthony Jamesanthony is offline
Contributor
 
Join Date: May 2003
Location: Dublin
Posts: 502
Default

how do i do that
I have an image which in vb i dont see the back white
in vb.net like this eee is VB image ddd is VB.NET.picturebox
Attached Images
File Type: jpg dddd.jpg (23.7 KB, 5 views)
File Type: jpg eee.jpg (18.7 KB, 6 views)
Reply With Quote
  #4  
Old 06-29-2006, 05:16 PM
MikeJ's Avatar
MikeJSimple when you know MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,747
Default

Set the TransparencyKey to Color.White (assuming that the transparent background is exactly white - &HFFFFFF)
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
  #5  
Old 06-29-2006, 05:38 PM
Jamesanthony's Avatar
Jamesanthony Jamesanthony is offline
Contributor
 
Join Date: May 2003
Location: Dublin
Posts: 502
Default

its not a property, is it possible at runtime ???
Reply With Quote
  #6  
Old 06-29-2006, 05:48 PM
MikeJ's Avatar
MikeJSimple when you know MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,747
Default

My mistake, I was assuming you were drawing directly to a form. Instead, you will need to create a graphics object and use MakeTransparent:
Code:
Dim g As Graphics = PictureBox1.CreateGraphics() Dim b As Bitmap = New Bitmap("YourFileName") b.MakeTransparent(Color.White) ' PictureBox.Image = b
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
  #7  
Old 06-30-2006, 10:56 AM
Jamesanthony's Avatar
Jamesanthony Jamesanthony is offline
Contributor
 
Join Date: May 2003
Location: Dublin
Posts: 502
Default

Thanks
Reply With Quote
  #8  
Old 07-01-2006, 07:53 AM
Jamesanthony's Avatar
Jamesanthony Jamesanthony is offline
Contributor
 
Join Date: May 2003
Location: Dublin
Posts: 502
Default

C:\AMPS\DotNET\Solitaire\frmSolitare.vb(364): 'MakeTransparent' is not a member of 'System.Drawing.Bitmap'.
got this error
any ideas ?
Reply With Quote
  #9  
Old 07-01-2006, 09:27 AM
MikeJ's Avatar
MikeJSimple when you know MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,747
Default

What version of .NET are you using? Works fine for me with .NET Framework 1.0
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
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
Simple when you know
Simple when you know
Simple when you know Simple when you know
Simple when you know
Simple when you know
Simple when you know Simple when you know Simple when you know Simple when you know Simple when you know Simple when you know Simple when you know
Simple when you know
Simple when you know
 
Simple when you know
Simple when you know
 
-->