Very Exclusive Tutorial!
Use this board to post your code snippets - tips and tricks
8 posts
Page 1 of 1
it saves a panel with all of his controls as a picture!
(all controls supported) Tutorial ;D
First!
add a panel with some labels or other controls,
Then!
add a other panel or a picture to display the picture of the panel with his controls.
You also need a button to let the code work ;)
if you want to save the picture direct use this code:
link to the code:
http://nomesoft.usersboard.com/t11-excl ... to-picture
(all controls supported) Tutorial ;D
First!
add a panel with some labels or other controls,
Then!
add a other panel or a picture to display the picture of the panel with his controls.
You also need a button to let the code work ;)
if you want to save the picture direct use this code:
Code: Select all
Then you need the add the codes, they will be at the link below.myBmp.Save("C:\mybmp.jpg")
link to the code:
http://nomesoft.usersboard.com/t11-excl ... to-picture
Is this like Panel1.DrawToBitmap?
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
Can you tell me the difference between your code and this code:
I have tried your code on my form, exact same effect.
Code: Select all
I modified the code above from this article, but it does the same job, so whats so unique/exclusive ? Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
PictureBox1.Image = GetPanelImage()
End Sub
Private Function GetPanelImage() As Bitmap
' Make the bitmap.
Dim wid As Integer = Panel1.Width
Dim hgt As Integer = Panel1.Height
Dim bm As New Bitmap(wid, hgt)
' Draw the form onto the bitmap.
Panel1.DrawToBitmap(bm, New Rectangle(0, 0, wid, hgt))
' If we want the borders, return the bitmap.
' Make a smaller bitmap without borders.
wid = Me.ClientSize.Width
hgt = Me.ClientSize.Height
Dim bm2 As New Bitmap(wid, hgt)
' Copy the part of the original bitmap that we want
' into the bitmap.
Dim gr As Graphics = Graphics.FromImage(bm2)
gr.DrawImage(bm, 0, 0, New Rectangle(0, 0, wid, hgt), _
GraphicsUnit.Pixel)
Return bm2
End Function
I have tried your code on my form, exact same effect.
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
Danny wrote:because I think it is Exclusive because i think it is .... >.<I use those kind of arguments on my tests as well! Just kidding :P I think it is exclusive as well. But why would i want to save my panel as .bmp? You better make a DLL from it and then import it in multiple programs...
Just my opinion :P
Practice makes perfect!
VIP since: 6-10-2011
VIP since: 6-10-2011
first it may be handy for some reason
second,.. how to make that?!
second,.. how to make that?!
Danny wrote:first it may be handy for some reasonJust use a usercontrol (project>add form and choose usercontrol). Create that one and build the dll. Import using toolbox!!
second,.. how to make that?!
Practice makes perfect!
VIP since: 6-10-2011
VIP since: 6-10-2011
8 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023