Click here to Skip to main content
15,887,485 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestiondataSets and TableAdapters Pin
ghazanfarKhan29-May-08 8:18
ghazanfarKhan29-May-08 8:18 
GeneralRe: dataSets and TableAdapters Pin
Tony Richards29-May-08 14:07
Tony Richards29-May-08 14:07 
QuestionDisable keyboard events Pin
Member 224184329-May-08 5:32
Member 224184329-May-08 5:32 
AnswerRe: Disable keyboard events Pin
jzonthemtn29-May-08 5:47
jzonthemtn29-May-08 5:47 
AnswerRe: Disable keyboard events Pin
parth.p29-May-08 7:24
parth.p29-May-08 7:24 
QuestionCannot Hide Message Box in Print Preview Pin
BooleanTrue29-May-08 4:37
professionalBooleanTrue29-May-08 4:37 
Answer[Duplicate Post. Ignore] Re: Cannot Hide Message Box in Print Preview Pin
Vasudevan Deepak Kumar29-May-08 23:54
Vasudevan Deepak Kumar29-May-08 23:54 
QuestionCheck if GDI+ bitmap has transparency Pin
TrekkieDK29-May-08 4:05
TrekkieDK29-May-08 4:05 
I have opened an image as a bitmap using GDI+. Before I save it I want to know if the image has transparency in it. That is; is there any pixels in the bitmap that has the transparent color. I have made a solution that looks like this:

Dim objImage As Drawing.Bitmap = Drawing.Image.FromFile("png_with_transparent_bg.png")
Dim booTransparentColorFound As Boolean = False
If Bitmap.IsAlphaPixelFormat(objImage.PixelFormat) Then
  For y As Integer = 0 To objImage.Height - 1
    If booTransparentColorFound Then Exit For
    For x As Integer = 0 To objImage.Width - 1
      Dim objColor As Drawing.Color = objImage.GetPixel(x, y)
      If objColor.A = Color.Transparent.A And _
         objColor.R = Color.Transparent.R And _
         objColor.G = Color.Transparent.G And _
         objColor.B = Color.Transparent.B _
      Then
        booTransparentColorFound = True
        Exit For
      End If
    Next
  Next
End If


The problem is that if the image is very big, and there is no transparent pixel in it (or a transparent pixel is located in the lower right corner), the routine is very slow. Is there some quicker way to determine if there is transparency in the image?

Thanks in advance.


...Allan, Denmark
AnswerRe: Check if GDI+ bitmap has transparency Pin
Guffa29-May-08 7:02
Guffa29-May-08 7:02 
GeneralRe: Check if GDI+ bitmap has transparency Pin
Christian Graus29-May-08 13:31
protectorChristian Graus29-May-08 13:31 
GeneralRe: Check if GDI+ bitmap has transparency Pin
Guffa29-May-08 15:18
Guffa29-May-08 15:18 
AnswerRe: Check if GDI+ bitmap has transparency Pin
Luc Pattyn29-May-08 21:52
sitebuilderLuc Pattyn29-May-08 21:52 
QuestionSaving PDF on local hard disk which is read by browser control Pin
Sunil Shindekar28-May-08 23:13
Sunil Shindekar28-May-08 23:13 
AnswerRe: Saving PDF on local hard disk which is read by browser control Pin
jzonthemtn29-May-08 1:40
jzonthemtn29-May-08 1:40 
GeneralRe: Saving PDF on local hard disk which is read by browser control Pin
Sunil Shindekar29-May-08 3:21
Sunil Shindekar29-May-08 3:21 
QuestionNeed help with a project, I am really stumped! Pin
Ogre72228-May-08 20:04
Ogre72228-May-08 20:04 
AnswerRe: Need help with a project, I am really stumped! Pin
Eduard Keilholz28-May-08 20:42
Eduard Keilholz28-May-08 20:42 
GeneralRe: Need help with a project, I am really stumped! Pin
Ogre72229-May-08 2:44
Ogre72229-May-08 2:44 
AnswerRe: Need help with a project, I am really stumped! Pin
Sam Xavier28-May-08 23:26
Sam Xavier28-May-08 23:26 
GeneralRe: Need help with a project, I am really stumped! Pin
Ogre72229-May-08 2:41
Ogre72229-May-08 2:41 
GeneralRe: Need help with a project, I am really stumped! Pin
Chinners29-May-08 3:14
Chinners29-May-08 3:14 
GeneralRe: Need help with a project, I am really stumped! Pin
Ogre72229-May-08 4:26
Ogre72229-May-08 4:26 
GeneralRe: Need help with a project, I am really stumped! Pin
Chinners29-May-08 4:57
Chinners29-May-08 4:57 
GeneralRe: Need help with a project, I am really stumped! Pin
Ogre72229-May-08 5:22
Ogre72229-May-08 5:22 
GeneralRe: Need help with a project, I am really stumped! Pin
Ogre72229-May-08 15:47
Ogre72229-May-08 15:47 

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.