Loading images from defined size and area....  
Author Message
NoLimit





PostPosted: Sun Apr 18 14:35:48 CDT 2004 Top

Visual Basic [VB] >> Loading images from defined size and area....

Is it possible to load the image to a button contol so that I can load only
the desired part of the image file through programmatically ?
thanks

Visual Studio44  
 
 
Armin





PostPosted: Sun Apr 18 14:35:48 CDT 2004 Top

Visual Basic [VB] >> Loading images from defined size and area....
> Is it possible to load the image to a button contol so that I can
> load only the desired part of the image file through programmatically
> ? thanks

Don't know if I understand you right. You could load the image and draw the
desired part on a new bitmap.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
 
Ram





PostPosted: Mon Apr 19 14:49:20 CDT 2004 Top

Visual Basic [VB] >> Loading images from defined size and area.... Thanks, can I get sample of code snippets on how to do that ?
Thank you very much.




> > Is it possible to load the image to a button contol so that I can
> > load only the desired part of the image file through programmatically
> > ? thanks
>
> Don't know if I understand you right. You could load the image and draw
the
> desired part on a new bitmap.
>
>
> --
> Armin
>
> How to quote and why:
> http://www.plig.net/nnq/nquote.html
> http://www.netmeister.org/news/learn2quote.html
>


 
 
Armin





PostPosted: Mon Apr 19 15:11:45 CDT 2004 Top

Visual Basic [VB] >> Loading images from defined size and area....
> Thanks, can I get sample of code snippets on how to do that ?
> Thank you very much.

dim img as image
dim bmp as bitmap
dim g as graphics

img = image.fromfile("file.bmp")
bmp = new bitmap(50, 50)
g = graphics.fromimage(bmp)
g.drawimage(img, 0, 0, new rectangle(20, 20, 50, 50))
g.dispose


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
 
hirf-spam-me-here





PostPosted: Mon Apr 19 15:08:37 CDT 2004 Top

Visual Basic [VB] >> Loading images from defined size and area....
> Thanks, can I get sample of code snippets on how to do that ?

Skeleton:

\\\
Dim b As New Bitmap(...)
Dim g As Graphics = Graphics.FromImage(b)
g.DrawImage(...)
g.Dispose()
Me.PictureBox1.Image = b
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>