Click here to Skip to main content
15,886,110 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: tif img print preview Pin
Dave Kreskowiak28-Sep-14 3:36
mveDave Kreskowiak28-Sep-14 3:36 
GeneralRe: tif img print preview Pin
drago1128-Sep-14 10:14
drago1128-Sep-14 10:14 
GeneralRe: tif img print preview Pin
Eddy Vluggen29-Sep-14 5:35
professionalEddy Vluggen29-Sep-14 5:35 
GeneralRe: tif img print preview Pin
James.Cook201-Oct-14 3:54
James.Cook201-Oct-14 3:54 
QuestionCreate Image from Panel Control Pin
gwittlock27-Sep-14 9:02
gwittlock27-Sep-14 9:02 
AnswerRe: Create Image from Panel Control Pin
Eddy Vluggen27-Sep-14 13:40
professionalEddy Vluggen27-Sep-14 13:40 
GeneralRe: Create Image from Panel Control Pin
gwittlock27-Sep-14 15:23
gwittlock27-Sep-14 15:23 
GeneralRe: Create Image from Panel Control Pin
gwittlock27-Sep-14 21:27
gwittlock27-Sep-14 21:27 
I found this bit of code to work with 2 exceptions. 1) how to re-size it to a smaller image (So I can display a thumbnail type image and 2) how to make the background transparent.

I want item 2 because the image is displayed in a panel control with a black background. That is what the user needs to see. But when I create the image I do not want the black background

VB
Private Sub my_capture(ctrl As Control, fileName As String)
       Dim bounds As Rectangle = ctrl.Bounds
       Dim pt As Point = ctrl.PointToScreen(bounds.Location)
       Dim bitmap As New Bitmap(bounds.Width, bounds.Height)
       Using g As Graphics = Graphics.FromImage(bitmap)
           g.CopyFromScreen(New Point(pt.X - ctrl.Location.X, pt.Y - ctrl.Location.Y), Point.Empty, bounds.Size)
       End Using

       bitmap.Save(fileName, ImageFormat.Png)
   End Sub

GeneralRe: Create Image from Panel Control Pin
Eddy Vluggen28-Sep-14 1:53
professionalEddy Vluggen28-Sep-14 1:53 
GeneralRe: Create Image from Panel Control Pin
gwittlock28-Sep-14 4:05
gwittlock28-Sep-14 4:05 
GeneralRe: Create Image from Panel Control Pin
drago1128-Sep-14 21:13
drago1128-Sep-14 21:13 
GeneralRe: Create Image from Panel Control Pin
gwittlock29-Sep-14 3:21
gwittlock29-Sep-14 3:21 
GeneralRe: Create Image from Panel Control Pin
Eddy Vluggen29-Sep-14 5:33
professionalEddy Vluggen29-Sep-14 5:33 
GeneralRe: Create Image from Panel Control Pin
Eddy Vluggen28-Sep-14 22:12
professionalEddy Vluggen28-Sep-14 22:12 
GeneralRe: Create Image from Panel Control Pin
gwittlock29-Sep-14 3:19
gwittlock29-Sep-14 3:19 
GeneralRe: Create Image from Panel Control Pin
Eddy Vluggen29-Sep-14 5:32
professionalEddy Vluggen29-Sep-14 5:32 
GeneralRe: Create Image from Panel Control Pin
gwittlock29-Sep-14 6:15
gwittlock29-Sep-14 6:15 
GeneralRe: Create Image from Panel Control Pin
gwittlock30-Sep-14 20:17
gwittlock30-Sep-14 20:17 
GeneralRe: Create Image from Panel Control Pin
Eddy Vluggen5-Oct-14 2:13
professionalEddy Vluggen5-Oct-14 2:13 
GeneralRe: Create Image from Panel Control Pin
gwittlock5-Oct-14 3:16
gwittlock5-Oct-14 3:16 
Questionvb Pin
Nishat Anwar27-Sep-14 6:41
Nishat Anwar27-Sep-14 6:41 
AnswerRe: vb Pin
Dave Kreskowiak27-Sep-14 6:47
mveDave Kreskowiak27-Sep-14 6:47 
QuestionRecommendations on VB.Net to C# code conversion tool Pin
Vipul Mehta26-Sep-14 10:28
Vipul Mehta26-Sep-14 10:28 
AnswerRe: Recommendations on VB.Net to C# code conversion tool Pin
Tim Carmichael26-Sep-14 11:24
Tim Carmichael26-Sep-14 11:24 
GeneralRe: Recommendations on VB.Net to C# code conversion tool Pin
Vipul Mehta27-Sep-14 3:21
Vipul Mehta27-Sep-14 3:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.