Help!  Graphics not working right!
Help!  Graphics not working right!
Help!  Graphics not working right!
Help!  Graphics not working right!
Help!  Graphics not working right!
Help!  Graphics not working right! Help!  Graphics not working right! Help!  Graphics not working right! Help!  Graphics not working right! Help!  Graphics not working right! Help!  Graphics not working right! Help!  Graphics not working right! Help!  Graphics not working right!
Help!  Graphics not working right! Help!  Graphics not working right!
Help!  Graphics not working right!
Go Back  Xtreme Visual Basic Talk > > > Help! Graphics not working right!


Reply
 
Thread Tools Display Modes
  #1  
Old 10-05-2005, 01:03 PM
3D-Reality 3D-Reality is offline
Regular
 
Join Date: Apr 2003
Posts: 62
Default Help! Graphics not working right!


I've got to use setpixel as I'm developing for a mobile.

There is nothing wrong with RenderBoard as far as I can tell but DrawBlock only draws 4 things before failing. Any ideas?
Code:
Private Sub DrawBlock(ByRef BMP As Bitmap, ByVal Color As Color, ByVal X As Integer, ByVal Y As Integer, ByVal Xend As Integer, ByVal Yend As Integer) 'MsgBox(BMP.Height & "," & BMP.Width) For mX As Integer = X To Xend - 1 For mY As Integer = Y To Yend - 1 BMP.SetPixel(mX, mY, Color) Next Next End Sub Public Function RenderBoard() As Bitmap Dim imgBoardBuffer As New Bitmap(SideThickness + (Points.GetUpperBound(0) - 1) * AreaSize, SideThickness + (Points.GetUpperBound(1) - 1) * AreaSize) 'Dim gfx As Graphics = Graphics.FromImage(imgBoardBuffer) DrawBlock(imgBoardBuffer, BgColor, 0, 0, imgBoardBuffer.Width, imgBoardBuffer.Height) For flX As Integer = 0 To Points.GetUpperBound(0) For flY As Integer = 0 To Points.GetUpperBound(1) Dim X, Y As Integer X = (flX * AreaSize) Y = (flY * AreaSize) If Points(flX, flY).Square = True Then DrawBlock(imgBoardBuffer, Points(flX, flY).Color, X + SideThickness, Y + SideThickness, AreaSize - SideThickness, AreaSize - SideThickness) End If If Points(flX, flY).Horizontal = True Then DrawBlock(imgBoardBuffer, SelLineCol, X + SideThickness, Y, AreaSize - SideThickness, SideThickness) Else DrawBlock(imgBoardBuffer, NormalLineCol, X + SideThickness, Y, AreaSize - SideThickness, SideThickness) End If If Points(flX, flY).Vertical = True Then DrawBlock(imgBoardBuffer, SelLineCol, X, Y + SideThickness, SideThickness, AreaSize - SideThickness) Else DrawBlock(imgBoardBuffer, NormalLineCol, X, Y + SideThickness, SideThickness, AreaSize - SideThickness) End If Next Next 'gfx = Nothing Return imgBoardBuffer End Function
Reply With Quote
  #2  
Old 10-05-2005, 06:16 PM
Iceplug's Avatar
IceplugHelp!  Graphics not working right! Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

The word "fail" has many different meanings even from a programming standpoint. What do you mean by "fail"? What happens that causes DrawBlock to "fail"?
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #3  
Old 10-06-2005, 11:23 AM
3D-Reality 3D-Reality is offline
Regular
 
Join Date: Apr 2003
Posts: 62
Default

Nevermind - I got it to work by entirely re-writing it. Unfortunately though the mobile phone isn't fast enough to redraw the whole game board - back to square 1 (rofl!)

John
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Help!  Graphics not working right!
Help!  Graphics not working right!
Help!  Graphics not working right! Help!  Graphics not working right!
Help!  Graphics not working right!
Help!  Graphics not working right!
Help!  Graphics not working right! Help!  Graphics not working right! Help!  Graphics not working right! Help!  Graphics not working right! Help!  Graphics not working right! Help!  Graphics not working right! Help!  Graphics not working right!
Help!  Graphics not working right!
Help!  Graphics not working right!
 
Help!  Graphics not working right!
Help!  Graphics not working right!
 
-->