By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

Need VBA Code to place color on a bitmap image

P: 5
I have a Visual basic 3 App that I am converting to VBA in Microsoft Access 2003. The VB3 app successfully recolors a bitmap image with code using pixel locations when clicking on option buttons used for color selection.
An example is:
Grphecho!Picture3.PSet (xpos, ypos), RGB(RRGB, GRGB, BRGB)

where the pixel positions are xpos and ypos in a Picture box(Picture3) using the Pset method.

I know about the need for twips instead of pixels in Access 2003, and can successfully convert my coded pixel values to twips by applying 15 twips to 1 pixel.

My problem is coding to the control on the Access form. How can I get an Image Control or Unbound Object Frame control to accept my x and y values from my code?

Thanks much to anybody for reviewing this.
Feb 28 '07 #1
Share this Question
Share on Google+
8 Replies


100+
P: 1,646
Hi. Is there a really pressing reason to convert to VBA? Why not vb6?
Feb 28 '07 #2

P: 5
JEO
I like Access. I have also used VB a lot. I have been developing software for many years and prefer the convenience of working with everything in one place - forms, reports, database, code, etc. I've never been stopped (i.e. needed to abandon Access VBA and get outside to solve my programming problem).
I have some intricate applications, mostly financial and medical customized.

This is a case of whether it is possible to write to a bitmap image and then save the changes in Access - so I'm persuing that solution first.

Any ideas about the specific problem?
Mar 1 '07 #3

Expert 5K+
P: 8,434
I like Access. I have also used VB a lot. I have been developing software for many years and prefer the convenience of working with everything in one place ...
Yes, that's what I've always like about Access too.

I'll be very interested to see whether you find an answer to this one; it's something I have wondered about from time to time, but not really pursued. Some of the limitations that Access VBA imposes on your VB code can be extremely frustrating.
Mar 1 '07 #4

100+
P: 1,646
I like Access. I have also used VB a lot. I have been developing software for many years and prefer the convenience of working with everything in one place - forms, reports, database, code, etc. I've never been stopped (i.e. needed to abandon Access VBA and get outside to solve my programming problem).
I have some intricate applications, mostly financial and medical customized.

This is a case of whether it is possible to write to a bitmap image and then save the changes in Access - so I'm persuing that solution first.

Any ideas about the specific problem?
I hate working with access. It feels far too amateur for me. Too limiting. I never use data bound controls and I do part of my programming in c++ because it runs so much faster. Access... yugh!
Mar 1 '07 #5

Expert 5K+
P: 8,434
I hate working with access. It feels far too amateur for me. Too limiting. I never use data bound controls and I do part of my programming in c++ because it runs so much faster. Access... yugh!
Perhaps, but at the time it was released, it was being compared to (for example) old versions of dBase. Access, with everything in one file, was a huge improvement over having various tables, indexs, forms, blah blah blah all in separate files.

And of course, the fact that I was already using VB (um... probably v1 or 3 at the time) meant that it was very nice the way Access just slotted right in.
Mar 1 '07 #6

NeoPa
Expert Mod 15k+
P: 31,487
Just posting to keep an eye.
Have you considered asking Killer to move this thread to the Access forum? That way it may be more visible to those with the skill sets you need. I'm afraid I haven't used the graphics side at all in Access so I can't help personally.
Mar 1 '07 #7

100+
P: 1,646
Just posting to keep an eye.
Have you considered asking Killer to move this thread to the Access forum? That way it may be more visible to those with the skill sets you need. I'm afraid I haven't used the graphics side at all in Access so I can't help personally.
Copied thread to Access forum
Mar 1 '07 #8

ADezii
Expert 5K+
P: 8,634
I have a Visual basic 3 App that I am converting to VBA in Microsoft Access 2003. The VB3 app successfully recolors a bitmap image with code using pixel locations when clicking on option buttons used for color selection.
An example is:
Grphecho!Picture3.PSet (xpos, ypos), RGB(RRGB, GRGB, BRGB)

where the pixel positions are xpos and ypos in a Picture box(Picture3) using the Pset method.

I know about the need for twips instead of pixels in Access 2003, and can successfully convert my coded pixel values to twips by applying 15 twips to 1 pixel.

My problem is coding to the control on the Access form. How can I get an Image Control or Unbound Object Frame control to accept my x and y values from my code?

Thanks much to anybody for reviewing this.
__1 I was under the impression that the Twips to Pixel ratio is related to the Screen Resolution with typical 640X480 using 15 Twips per Pixel and most of the other Resolutions using 12 Twips per Pixel but this is hardly your main problem.
__2 In my opinion, the only possible chance you have to allow an Access Control to accept individual xPos and yPos Pixel location values, is via the Windows API which is very rich in this specifc type of functionality.
__3 The other problem is that you can be fairly assured that whatever API Call you attempt to make in this unique situation will most certainly require a Windows Handle (hWnd Property). To the best of my knowledge, the limited number of Controls that can accept Graphic data, do not have this hWnd Property since they are not true Windows. Forms and Reports have Handles (hWnd) but, again, I'm fairly sure that Controls contained within them do not.
__4 I apoplogize for being so negative but I do not think that what you are requesting is feasible. My only suggestion is to consult a professional Windows Programmer with some Access familiarity.
Mar 2 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.