Click here to Skip to main content
15,905,915 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionMessage Box just before creating print preview Pin
BooleanTrue29-May-08 22:17
professionalBooleanTrue29-May-08 22:17 
AnswerRe: Message Box just before creating print preview Pin
Steven J Jowett29-May-08 22:48
Steven J Jowett29-May-08 22:48 
GeneralRe: Message Box just before creating print preview Pin
BooleanTrue29-May-08 23:15
professionalBooleanTrue29-May-08 23:15 
GeneralRe: Message Box just before creating print preview Pin
Steven J Jowett29-May-08 23:25
Steven J Jowett29-May-08 23:25 
GeneralRe: Message Box just before creating print preview Pin
darkelv30-May-08 2:13
darkelv30-May-08 2:13 
GeneralRe: Message Box just before creating print preview Pin
Dave Kreskowiak31-May-08 2:35
mveDave Kreskowiak31-May-08 2:35 
GeneralRe: Message Box just before creating print preview [modified] Pin
BooleanTrue3-Jun-08 2:35
professionalBooleanTrue3-Jun-08 2:35 
AnswerRe: Message Box just before creating print preview Pin
Vasudevan Deepak Kumar29-May-08 23:53
Vasudevan Deepak Kumar29-May-08 23:53 
QuestionCompiling Questions Pin
Maffyx29-May-08 14:17
Maffyx29-May-08 14:17 
AnswerRe: Compiling Questions Pin
jzonthemtn29-May-08 15:21
jzonthemtn29-May-08 15:21 
GeneralRe: Compiling Questions Pin
Maffyx29-May-08 15:25
Maffyx29-May-08 15:25 
QuestionReturning an array from a function Pin
Eric Burns29-May-08 11:47
Eric Burns29-May-08 11:47 
AnswerRe: Returning an array from a function Pin
Luc Pattyn29-May-08 12:09
sitebuilderLuc Pattyn29-May-08 12:09 
GeneralRe: Returning an array from a function Pin
Tony Richards29-May-08 14:04
Tony Richards29-May-08 14:04 
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 

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.